Larry Brouwer

... just my personal technology sandbox

  • About
  • Blog
  • Archives
  • Contact

Connect

  • Email
  • Facebook
  • LinkedIn

Powered by Genesis

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

January 27, 2016 By Larry Brouwer Leave a Comment

I recently set up a new Linux (CentOS 7) box as a Magento development environment for one of our clients. I was primarily interested in using Magento Connect to do an upgrade from Magento 1.9.2.2 to Magento 1.9.2.3. When I tried to use the Magento Connect Manager, however, I immediately started running into issues. I kept getting the warning message, Warning: Your Magento folder does not have sufficient write permissions and wasn’t able to continue.

magento-connect-manager

After Googling numerous times, and verifying my file permissions, and apache and php configurations, I still wasn’t able to solve the problem. Everything seemed to be configured correctly!

So, I created a simple php script to help me figure out what was going on:

<?php
echo `whoami`;
file_put_contents(‘/var/www/html/magento/var/log/test.txt’,’hello’,FILE_APPEND);
?>

The result was that the php process was indeed running as apache, and that I wasn’t able to write to the test.txt file. I was able to see the errors being generated in the php error log as:

[Wed Jan 27 11:50:09.557315 2016] [:error] [pid 15256] [client 192.168.1.112:57119] PHP Warning:  file_put_contents(/var/www/html/magento/var/log/test.txt): failed to open stream: Permission denied in /var/www/html/magento/testing.php on line 4, referer: http://centos.trl.local/magento/testing.php

Armed with this information, I started searching Google again, and came up with this post, which lead me to this post. After following the instructions found here, I was able to continue with my upgrade.

Commands used to resolve my file permission issue:

#getenforce
Enforcing
#cd /etc/selinux
#cp config config.orig
#vi config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing – SELinux security policy is enforced.
#     permissive – SELinux prints warnings instead of enforcing.
#     disabled – No SELinux policy is loaded.
#SELINUX=enforcing
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
#     targeted – Targeted processes are protected,
#     minimum – Modification of targeted policy. Only selected processes are protected.
#     mls – Multi Level Security protection.
SELINUXTYPE=targeted

#setenforce 0

(no need to reboot)

I hope this helps someone else!

Filed Under: Notable Tagged With: CentOS, Linux, Magento

Recent Posts

  • Weaver’s Bamboo “Bambusa textilis” clumping bamboo for sale
  • configuring NTP Service on FreeNas, XenServer, and virtualized Windows Server 2012 R2 Domain Controller
  • CentOS 7 Warning: Your Magento folder does not have sufficient write permissions.
  • AOE Scheduler 1.3.0 cron issue with Magento 1.9.2.2

Tag cloud

Maytag TomatoCart SVN Spam Neptune mstsc.exe IIS7 301 Linux Scanpst.exe Magento Blogs Windows Remote Desktop SmarterMail ASP.Net SMTP MySQL SSMS SqlServer SBS2011 Yahoo Mail C# eCommerce PHP Azure OpenCart web.config CentOS Security DotNetNuke BlogEngine.Net AWStats PrestaShop Silverlight Comcast OfficeLive Visual Studio Port 25 Log Parser Outlook 2007 PST DIR-655 SSL iframe clumping bamboo