Magento Forum

   
PEAR Upgrade Error - permission denied (delete)
 
ptjedi
Sr. Member
 
Avatar
Total Posts:  250
Joined:  2008-03-12
Porto, Portugal
 

Hi guys,

I wonder if anyone knows how to fix this. I have just moved one magento installation from one server to another (1.1.4) and when I tried to upgrade it using Magento Connect Manager, it downloads the package but then these errors appear for every single file:

...
permission denied (delete): /home/backup/public_html/report/skin/default/index.phtml
permission denied 
(delete): /home/backup/public_html/report/config.xml
permission denied 
(delete): /home/backup/public_html/report/index.php
permission denied 
(delete): /home/backup/public_html/var/.htaccess
permission denied 
(delete): /home/backup/public_html/app/code/core/Zend/Cache/Backend/Apc.php
permission denied 
(delete): /home/backup/public_html/app/code/core/Zend/Cache/Backend/File.php
permission denied 
(delete): /home/backup/public_html/app/code/core/Zend/Cache/Backend
...
ERRORcommit failed

I have set every file in server to 644 and every directory to 777.
What can I be doing wrong? This is the first time this is not working properly…

Thanks for any help.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Sindre|ProperHost
Mentor
 
Avatar
Total Posts:  1155
Joined:  2008-04-24
 

Probably the webserver (e.g. Apache) is running under a user different from yourself. For example, when Apache is installed with PHP as a module (mod_php), all PHP scripts will be executed with the rights of the webserver, which often is ‘nobody’, ‘www’ or similar.

If your files have 644 permissions, it means the server will not be able to write to the file. In such setup, any file that should be writable by the webserver would need the ‘Others’ write bit set, e.g. chmod 777. This is dangerous though, as anybody would be able to write to your file.

Another thing that can be causing this is that your account on the new server has a different username than the old one, but the file owner remains the same as before. If that is the case, you should run the following command from a shell:

chown -R yourUser:yourUser /path/to/magento/

This will change the owner of each file/folder under your magento directory to ‘yourUser’.

 
Magento Community Magento Community
Magento Community
Magento Community
 
ptjedi
Sr. Member
 
Avatar
Total Posts:  250
Joined:  2008-03-12
Porto, Portugal
 

Thank you Sindre. I will try do that. I don’t have shell access but I may temporarily change everything to 777 and then get it back to 644. Even though is a hell of a work (it usually takes 2 to 3 hours to complete everything). Thanks again! I will post here any advancement for future reference.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Crucial
Enthusiast
 
Avatar
Total Posts:  770
Joined:  2007-11-07
Phoenix, AZ
 

Create a PHP info file and post the link here, it will help with debugging.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top