htaccess file exists in the proper directory, but Drupal can't find it...

kpm - May 28, 2007 - 01:41

I have just installed on a shared host for a multiple site set up. I have set the 'files' directory in the /sites/example1.com/files/, /sites/example2.com/files/, etc and given the webserver rights to all of the 'files' directories. I am left with the following error however when I attempt to change the 'Garland' colour scheme:

    * warning: fopen() [function.fopen]: SAFE MODE Restriction in effect. The script whose uid/gid is 27177/27177 is not allowed to access sites/example1.com/files/.htaccess owned by uid/gid 99/99 in /mounted-storage/home54b/sub001/sc36226-MEBA/www/drupal-5.1/includes/file.inc on line 117.
    * warning: fopen(sites/example1.com/files/.htaccess) [function.fopen]: failed to open stream: Success in /mounted-storage/home54b/sub001/sc36226-MEBA/www/drupal-5.1/includes/file.inc on line 117.
    * Security warning: Couldn't write .htaccess file. Please create a .htaccess file in your sites/example1.com/files directory which contains the following lines:
      SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
      Options None
      Options +FollowSymLinks
    * The settings have not been saved because of the errors.

I have checked and checked, and that file exists on the server in the proper directory with the same contents as above. Can anyone think of a reason Drupal can't see the htaccess file?

Thanks

=-=

VeryMisunderstood - May 28, 2007 - 04:25

It's saying it can't write the .htaccess file, have you checked its persmissons ? are they set to 644 ?

Not sure about that SAFE MODE error.

Is the .htaccess file self created ? or are you using one from a previous drupal install ? maybe from a fresh download ?

Thanks, fixed with directory ownership

kpm - May 29, 2007 - 03:21

I granted the server ownership of the 'files' directory all its contents, htaccess included. And then had to set the server to not be in 'safe mode', which thankfully, the control panel at Servage allowed for. Not sure what kind of security issues this may open though... will probably switch it back after I play with this for a bit.

=-=

VeryMisunderstood - May 29, 2007 - 03:23

Safe mode can be very restricting for PHP to run in, Quite a few apps won't run properly with it. As far as security holes being opened, Just make sure you update yoru site when updates are due, and don't use any questionable PHP unless you know what it is you are using.

 
 

Drupal is a registered trademark of Dries Buytaert.