找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1896|回复: 1

Warning: Your Magento folder does not have sufficient write permissions.

[复制链接]
发表于 2013-5-27 22:01:59 | 显示全部楼层 |阅读模式
I have A pretty huge issue to work out here. I am installing a fresh install of Magento ver. 1.5.0.1. I set (and double-checked) that all of my directories were set to the proper permissions to install Mage.
My problem is that my Magento Connect manager is throwing the permissions error copied below. I have searched and searched and searched for a solution to this problem… I even basically ruined 3 weeks worth of work by running a recursive permissions script via SSH (some script that I copied out of the Magento forums from someone having a similar problem.)
My problem is, I don’t want to run scripts that I don’t know what they do. They can ruin my entire site, and I don’t trust them. There HAS to be a way to fix this problem manually. I am seeing this same error going back to 2008. Has Magento really missed the bus on this huge of an issue for this long?
I have even tried to set up the new FTP option in Mage 1.5.0.1., but cannot seem to get that to work either. (Anyone know what the “Installation Path:” field needs to be set to?)
Someone please help!!!
ERROR:
Warning: Your Magento folder does not have sufficient write permissions.
If you wish to proceed downloading Magento packages online, please set all Magento folders to have writable permission for the web server user (example: apache) or set up FTP Connection on the Magento Connect Manager Settings tab.


The following is 100% safe to run from the directory where Magento is installed:
  1. find . -type f -exec chmod 644 {} \;
  2. find . -type d -exec chmod 755 {} \;
  3. chmod o+w var var/.htaccess app/etc
  4. chmod 550 mage
  5. chmod -R o+w media
复制代码
If that is not working, try setting all directories to 777 by doing this:
  1. find . -type f -exec chmod 644 {} \;
  2. find . -type d -exec chmod 777 {} \;
  3. chmod o+w var/.htaccess
  4. chmod 550 mage
复制代码
you should reset your permissions back after installation:
  1. find . -type f -exec chmod 644 {} \;
  2. find . -type d -exec chmod 755 {} \;
  3. chmod o+w var var/.htaccess app/etc
  4. chmod 550 mage
  5. chmod -R o+w media
复制代码
You will, however, need to update them again to use Magento Connect.



 楼主| 发表于 2013-5-27 22:04:40 | 显示全部楼层
本帖最后由 Test 于 2013-5-27 22:12 编辑

Usually, if you are correct assigned the group, only 755 needed instead of 777.
in my case (Ubuntu localhost + XAMPP 1.7.3a + Magento 1.5.1.0) any previous commands didn’t help me
So, I always like to find reason
And I found.
First of all be sure that your Apache has ‘write’-access to your root of project.
For example:
/var/www/data/magentocommerce/htroot/
It’s enough to set 775 for root directory if Apache in group with you.
Look at httpd.conf
User nobody
Group nogroup  <--- change it for your group name [i.e. Group mygroup]
Restart Apache (don’t forget)
Then, you just need this command also:
chmod 775 downloader/
Refresh your Magento Connect page. Enjoy No red string anymore.
!!! DON’T SET 777 for everything in your project!!! This is bad idea.

P.S. my additional commands was:
  1. chmod 775 ./
  2. chmod 775 downloader/
复制代码
P.P.S. Also look at file: /downloader/target.xml
I guess this directories must be writable for Apache.

In another case (Ubuntu4.10 + PHP Version 5.3.2-1 + Magento 1.6.1.0)
1) In directory /var/www/your_site/
   cd /var/www/your_site
2) Setting folder owner
   sudo chown your_user_ftp:www-data -R public_html/
   Look vim /etc/apache2/envvars
   Group www-data
   2.1) Adding user in group www-data
   sudo adduser your_user_ftp www-data
3) Resetting File Permissions Magento
    sudo find . -type f -exec chmod 644 {} \;
    sudo find . -type d -exec chmod 755 {} \;
    sudo chmod o+w var var/.htaccess app/etc
    sudo chmod 550 lib/PEAR
    sudo chmod -R o+w media
    http://www.magentocommerce.com/w ... ng_file_permissions
4) Adding directory permission for group www-data
sudo find . -type d -exec chmod 775 {} \;
4) Restart Apache (don’t forget)

More genearic procedure like:
  1. cd TO YOUR MAGENTO FOLDER!!!! (PLEAS DOUBLE CHECK THIS)

  2. chown -R apache .
  3. chgrp -R apache .
  4. find . -type f -exec chmod 644 {} \\;
  5. find . -type d -exec chmod 755 {} \\;
  6. chmod o+w var var/.htaccess includes includes/config.php app/etc
  7. chmod -R o+w media
  8. rm -rf var/cache/*
  9. rm -rf var/session/*
  10. chmod 755 -R var
复制代码
remember:

You just set 777 permissions as usual on these folders (including their subdirectories):
  1. /var


  2. /media


  3. /downloader  
复制代码
Then, as already stated by someone in another thread, to let magento connect work you also have to set 777 permissions to the root directory of magento (i.e. the folder where magento has been uploaded: could be “/httpdocs/” or “/public_html/” or similar if you installed it on the webserver’s root - or could be “/shop” or “/magento” or “/whatever” if you chose to install it inside a subfolder).

In this case there’s no need to apply 777 permissions to subdirectories. Just grant 777 to magento’s root folder.
Once you’re done installing extensions, just revert permissions of magento’s root folder to the old value (750, in my case).




您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|BC Morning Website ( Best Deal Inc. 001 )

GMT-8, 2026-6-13 13:39 , Processed in 0.017960 second(s), 16 queries .

Supported by Weloment Group X3.5

© 2008-2026 Best Deal Online

快速回复 返回顶部 返回列表