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

AOE Scheduler 1.3.0 cron issue with Magento 1.9.2.2

November 23, 2015 By Larry Brouwer Leave a Comment

I recently upgraded a client’s Magento environment from 1.9.2.1 to 1.9.2.2 and I ran into some issues with the cron process. After reading a few posts with other people having similar issues, here, here, here, I decided to implement AOE Scheduler  (also available on GitHub, here) as this plugin gives me more visibility to what jobs are being processed, and additionally more flexibility, and control of the cron process. I was also hoping that my cron issues would be solved with this plugin! After installation, I followed the instructions for adding the AOE jobs to cron, but I still couldn’t get anything to work. After some quick debugging, I discovered that the jobs would run from the command line, but not from cron. The jobs I created are as per instructions below:

 

image

 

The error messages being generated from cron immediately lead me to the cause and its location. The problem was on line 3 of \shell\scheduler.php:

require_once dirname($_SERVER[‘SCRIPT_NAME’]) . DIRECTORY_SEPARATOR . ‘abstract.php’;

The fix that worked for me was:

require_once(dirname(__FILE__). DIRECTORY_SEPARATOR . “abstract.php”);

I hope this might help someone else!

Filed Under: Notable Tagged With: 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

Spam PST Visual Studio WordPress SmarterMail Google Analytics Azure Security DIR-655 TomatoCart D-Link Log Parser Exchange 2010 Yahoo Mail C# SSMS web.config Blogs eCommerce .NET Framework BlogEngine.Net Maytag Windows Remote Desktop OpenCart Outlook Connector redirect DotNetNuke Outlook 2007 clumping bamboo Database Mail iframe SBS2011 Neptune Silverlight ASP.Net SVN Live Writer Linux Magento SSL Windows 7 301 Scanpst.exe PrestaShop mstsc.exe