ThingyMaJig

Thingy Ma Jig is the blog of Nicholas Thompson and contains any useful tips, sites and general blog-stuff which are considered interesting or handy!

Connect

LinkedIn GitHub

Topics

announcement 25 apache 3 Apple 1 bash 8 code 7 cool 30 Days Out 8 Dark Basic Pro 4 design 12 doctor who 1 Drupal 74 E4600 1 EOS 400D 3 firefox 2 Flickr 3 free 21 games 5 geek 38 git 2 GreaseMonkey 1 hardware 7 Homebrew 1 How to 37 humour 5 iphone 1 javascript 1 jquery 1 K800i 6 k850i 4 lighttpd 3 linux 33 mac 9 miscellaneous 4 mobile phone 9 music 4 mysql 8 n73 1 n95 1 New Relic 1 Ogre3D 1 OS X 2 performance 3 photos 10 programming 40 Quicksilver 1 review 19 security 3 SEO 6 software 12 svn 2 technology 4 tip 7 tips 10 tv 3 video 3 vim 7 webdev 2 websites 33 wii 1 windows 1 YADS 10

Patching can cause permission denied errors

Posted on 11 August 2009 in
linux How to geek Drupal

I just updated this server to PHP 5.3. As all my sites are Drupal 6 it seems I have a few issues ahead which mean I need to patch Drupal to stop PHP complaining about deprecated stuff…

So I headed over to the post on drupal.org which is discussing 5.3 compatibility in Drupal 6 (which I personally think SHOULD go in) to grab a patch. I applied the patch with no problems. I refreshed a page and got a white screen so I checked the logs only to see…

2009-08-11 12:30:10: (mod_fastcgi.c.2618) FastCGI-stderr: PHP Warning:  require_once(./includes/file.inc) [function.require-once]: failed to open stream: Permission denied in /path/to/drupal_installation/drupal/includes/common.inc on line 2562

Well that was odd. I checked the file and the folders and all permissions were fine. I then had to waste the next hour of my life googling for the problem. It turns out that if you run a RedHat based distro (such as CentOS 5.3) you get a lovely application called SE Linux. SE Linux is meant to be there to protect you. From my experience it seems to spend more time pissing you off.

A quick test to confirm that SE Linux was causing my permission errors was to run the following (as root) from the terminal:

echo 0 > /selinux/enforce

Best to make sure you switch it back on afterwards ;-) but first I need to find out why SE Linux is complaining about a file being patched.