Page 1 of 1
serendipity needs to be able to write the file ".htacce
Posted: Thu Dec 02, 2004 7:41 am
by guustaaf
I have set the directory to 777 and I still get this message:
"To check your local webserver installation, serendipity needs to be able to write the file ".htaccess". This was not possible because of permission errors."
What gives? Can I write the .htaccess file for it?
Guustaaf
Web Master
www.whatthebleep.com
Re: serendipity needs to be able to write the file ".ht
Posted: Thu Dec 02, 2004 2:10 pm
by garvinhicking
I have seen this happen recently on a strange hosting environment with a wrong setup open_basedir restriction.
Which s9y version are you using, so I can tell you where to look for a certain line and remove a character there...
Regards,
Garvin.
Re: serendipity needs to be able to write the file ".ht
Posted: Thu Dec 02, 2004 8:03 pm
by Guest
garvinhicking wrote:I have seen this happen recently on a strange hosting environment with a wrong setup open_basedir restriction.
Which s9y version are you using, so I can tell you where to look for a certain line and remove a character there...
Regards,
Garvin.
Version 0.7
Guustaaf
Re: serendipity needs to be able to write the file ".ht
Posted: Fri Dec 03, 2004 10:44 am
by garvinhicking
Okay, then please open your file "serendipity_functions_installer.inc.php", go to function 'serendipity_printConfigTemplate', line 272. There replace all following occurences from '@fopen' to 'fopen'.
Then please try again to install, it should then give you a more detailed error output message why writing the .htaccess has failed!
Regards,
Garvin.
Re:serendipity needs to be able to write the file ".hta
Posted: Thu Dec 09, 2004 4:34 pm
by Stian
Hi,
same problem here, shared hosting on dreamhost.com. Here is the verbose error:
Code: Select all
Warning: fopen(/dh/cgi-system/.htaccess): failed to open stream: Permission denied in /home/.danielle/stian/lund.ws/s9y/serendipity_functions_installer.inc.php on line 272
To check your local webserver installation, serendipity needs to be able to write the file ".htaccess". This was not possible because of permission errors. Please adjust the permissions like this:
chmod go+rwx /home/.danielle/stian/lund.ws/s9y/
and reload this page.
Here are the permissions on the directory:
Code: Select all
drwxrwxrwx 10 stian pg141657 4096 Dec 9 16:11 .
drwxr-x--x 12 stian pg141657 4096 Dec 7 14:26 ..
drwxrwxrwx 12 stian pg141657 4096 Dec 9 16:26 s9y
The server is running some exec_php which means that files need only be writeable by myself, not the 'nobody' server user. pg141657 is my users group ID on the host I believe.
I'd really like to try out serendipity, it looks very cool, so I hope this can be fixed somehow...
Stian
Re:serendipity needs to be able to write the file ".hta
Posted: Thu Dec 09, 2004 7:36 pm
by garvinhicking
Okay, I see the problem - it tries to write to /dh/cgi-system -- this means some server side variables (DOCUMENT_ROOT or similars, don't know the exact variable name) are set wrong. Usually they should point to /home/.daniell etc. but they do not in your case.
Are you using Apache? And how is your setup exactly? I could try to offer you a patch, if you give me a phpinfo() output snippet (you can mail it privately, if you want)...
Regards,
Garvin
Re:serendipity needs to be able to write the file ".hta
Posted: Thu Dec 09, 2004 7:55 pm
by Guest
Here's my PHPInfo output:
http://www.lund.ws/phpinfo.php
Looks like the problem might be that PHP is running as a cgi at /dh/cgi-system/php.cgi -- we have a choice of running PHP as cgi for more security, or an Apache module. I guess the installer tries to write .htaccess in the same dir as php.cgi...
Here's some more info from my webhost on this issue:
https://panel.dreamhost.com/kbase/index.cgi?area=2933
Especially this section could be a clue:
Code: Select all
The $_SERVER['SCRIPT_NAME'] variable will return the php.cgi binary rather than the name of your script
Stian
Fixed it, thanks for the help!
Posted: Fri Dec 10, 2004 10:37 pm
by Stian
Ok,
guess I just needed someone to point me in the right direction -- I had a look in the code file and commented out the bit using the wrong variable, like so:
serendipity_functions_installer.inc.php
Code: Select all
function serendipity_httpCoreDir() {
//if (!empty($_SERVER['SCRIPT_FILENAME'])) {
// return dirname($_SERVER['SCRIPT_FILENAME']) . '/';
//}
return $_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['PHP_SELF']) . '/';
}
?>
The problem was using the SCRIPT_FILENAME variable and not PHP_SELF.
It works nicely now, but I'm definitely not sure if this was the preferred method of fixing this. If there are better fixes please do tell...
Hope you guys can fix this bug in newer versions, so that people using PHP as cgi can avoid doing this when installing every time
cheers,
Stian
Re: Fixed it, thanks for the help!
Posted: Sat Dec 11, 2004 5:40 pm
by garvinhicking
Thanks a lot for that information! I will add a check to detect the CGI environment and use a different variable - effectively it should be the same as commenting out like you did.
Best regards,
Garvin.
Thanks Stian
Posted: Thu Dec 30, 2004 9:49 pm
by knokenet
I too had the same problem.
Commented out the script name from the serendipity_httpCoreDir function, and all is well and working.
I'm so happy that I can use this brilliant system!
