Patching can cause permission denied errors

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) [<a href="function.require-once">function.require-once</a>]: 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.

Comment Icon

1 Comments

The most recent comment was on Tue, 11th Aug 2009 - 18:41

Add new comment

Filtered HTML

  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <pre> <ul> <ol> <li> <dl> <dt> <dd> <img> <p>
  • You can use BBCode tags in the text. URLs will automatically be converted to links.
  • You can enable syntax highlighting of source code with the following tags: <code>, <pre>, <bash>, <css>, <html>, <js>, <jquery>, <mysql>, <php>. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.