I am asking this question over here with the hope that it would be solved by somebody.I have a project in Codeigniter v3.1.3.In the assets/admin/uploads/photostory_img directory i have some image files which i am trying to delete using the 'unlink' method.My unlink code in the Controller is like :
unlink("assets/admin/uploads/photostory_img/".$ps_old_img);
However, i'm getting errors like:
A PHP Error was encountered
Severity: Warning
Message: unlink(assets/admin/uploads/photostory_img/): Permission denied
Filename: nautics/Pstory.php
Line Number: 293
Backtrace:
File: C:\wamp64\www\JSNCI\application\controllers\nautics\Pstory.php
Line: 293
Function: unlink
File: C:\wamp64\www\JSNCI\index.php
Line: 315
Function: require_once
I have searched all over the internet and SO also having similar question , but no success yet.Pleas help me.Its driving me crazy.
Seems you don't have anything in your $ps_old_image var so you are trying to delete directory with unlink. Check what's inside your variable.
Second problem may be your path. I use unlink in my projects and I delete files with something like:
unlink("./assets/admin/uploads/photostory_img/".$ps_old_img);
Of course it depends on your certain situation, where do you have your index.php.
Related
I'm trying to export an cvs file but I'm having this error.
Fatal error: Call to undefined method
Mage_Adminhtml_Model_System_Config_Source_Yesno::setAttribute() in
/home/acdistri/public_html/app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php
on line 389
thanks for your quick interest in this question... I found the solution... when I install a extension it create an Attribute, then I uninstall the extension because a JavaScript conflict but the attribute stay there and when I was trying to do the export of the products data base it give me that error. I just delete the attribute and now is working all fine.
I did the following commands:
composer global require "laravel/installer=~1.1"
and
set PATH=%PATH%;%USERPROFILE%\AppData\Roaming\Composer\vendor\bin
But when I try to do:
laravel new blog
I get the following error:
Notice: Undefined variable: output in C:\Users\****\AooDara\Roaming\Composer\vendor\laravel\installer\src\NewCommand.php on line 55
Fatal error: Call to a member function writeln() on null in C:\Users\****\AooDara\Roaming\Composer\vendor\laravel\installer\src\NewCommand.php on line 55
Any idea of what went wrong?
Seems like you already have a directory called 'blog' in your application directory. Try creating a laravel app with different name or delete / rename existing 'blog' directory and try again.
for example laravel new helloapp.
However, I think the error showing at the console is a bug of laravel new command. I could see the error at the console when I tried to create a app with same name again from same directory.
The error not exists now. Try creating other application.
I was creating a simple CodeIgniter site on my WAMP and all runs well.
But when uploaded to the host it says CI_Controller not found in CodeIgniter.php
Fatal error: Class 'CI_Controller' not found in /home/<myhost>/public_html/pms/system/core/CodeIgniter.php on line 233
I checked all the paths and seems right, i even went to the CodeIgniter.php file.
My database was migrated from local to the host, config was set, still this error comes out.
Is there something I'm missing? I really cant find anything on the net that could allow me to understand why it returns an error.
Hope someone could help understand this.
Thanks.
CodeIgniter will most probably figure out the base_url by itself:
$config['base_url'] = '';
... should work.
Fatal error: Class 'CI_Controller' not found in /home//public_html/pms/system/core/CodeIgniter.php on line 233
The path is not correct /home/public_html/pms/system/core/CodeIgniter.php
After adding to my frontend/default/[theme]/ folder I hit an error where the site would no longer load. I removed the offending file, but the site still won't load. Enabling PHP error output leads to this message:
Fatal error: Call to a member function getAllOptions() on a non-object in C:\websites\[snip]\htdocs\app\code\core\Mage\Core\Model\Cache.php on line 449
I have cleared the cache, and nothing is being created in the var/cache folder when pages are (attempted to be) loaded... Any ideas what else could be cached somewhere?
Also note, this has taken both the frontend and backend offline, so I have no access to the admin system.
This appears to be the same problem mentioned here (site down - Fatal error: includes/src/Mage_Core_Model_Cache.php on line 434). I don't have the compiler enabled though, so the error is directly in Core/Model/Cache.php.
In my case this problem occured because my app/etc/config.xml file was missing.
Try to see if your XML's config files are there.
Solution:
copy app/etc/config.xml from original magento to your magento.
Here is the way to fix it (It worked for me after lot of research):
chmod 644 app/etc/config.xml
chmod 755 app/etc
chmod 755 app/etc/modules
rm -rf var/cache/* var/session/*
php shell/indexer.php --reindexall
I moved a Pyrocms site to another server.
Go to index: blank page.
Turn on errors: get this
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Pages::$session
Filename: core/Model.php
Line Number: 50
Fatal error: Call to a member function set_flashdata() on a non-object in /var/www/vhosts/brokentalkers.com/httpdocs/system/pyrocms/modules/modules/models/module_m.php on line 193
If it sheds any light, I made a tar.gz of the contents of the old httpdocs folder, and extracted it in the new httpdocs folder.
I made a duplicate of the database with an identical user, so config/database.php shouldn't need changing.
Any ideas? Thanks in advance.
It seems like $session class is not initializing correctly.
Check for default_ci_sessions table, if you are using sessions for database.
Check if the constructor is loading sessions library.
Check if session is in autoload.php config