Page 1 of 1

Another open_basedir problem

Posted: Fri Aug 18, 2006 6:17 pm
by stadskle
I see that several people are having problem with this, but I really can't find any good solutions to my problem in other posts.

I'm -trying to- install Seredipity 1.0.1 on a shared host with PHP 5.1.5. After uploading the files I get this error message before the "
- Serendipity v1.0.1 pre-installation report -" :

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/usr/local/apache2/htdocs/serendipity_admin.php) is not within the allowed path(s): (/home/vusers/domains/stadskleiv.no:/home/vusers/users/ketil:/tmp:/var/tmp:/usr/local/bin:/usr/local/lib/php:.) in /home/vusers/domains/stadskleiv.no/subdomains/ketil/include/functions_installer.inc.php on line 192

My PHP.ini settings concerning this are:
open_basedir no value no value
safe_mode Off Off

Why is this happening and what can I do to solve it? As far as I can see the file_exists function is checking for a file in the dir /usr/local/apache2/htdocs/serendipity_admin.php and I really can't understand why since my web-folder is /home/vusers/users/ketil/stadskleiv.no/subdomains/ketil

Since this is a shared host am not allowed to change the php.ini, but I can set settings using .htaccess.

Re: Another open_basedir problem

Posted: Fri Aug 18, 2006 7:53 pm
by garvinhicking
Hi!

If you get this error, open_basedir is in effect! Check the output of a <?php phpinfo(); ?> script, and it will show you that it's enabled.

The error message seems to come because you have s9y put into /usr/local/apache2/htdocs, but your open_basedir list does not include this path.

So in all cases that have yet been reported on the forums here regarding this problem, it always sadly was a misconfiguration of the webserver. :)

You might not be allowed to disable open_basedir, as you mentioned. Thus you should address your server admin and ask him if he either can

* remove the serendipity installation in /usr/local/apache2/htdocs
* remove /usr/local/apache2/htdocs from your PHP include_path
* add /usr/local/apache2/htdocs to your open_basedir listing
* or disable the open_basedir restriction :)

Best regards,
Garvin[/i]

Posted: Fri Aug 18, 2006 9:20 pm
by stadskle
Yes it seems like s9y is put in /usr/local/apache2/htdocs but I it is not! I have my files in:

/home/vusers/users/ketil/stadskleiv.no/subdomains/ketil

My open_basedir value in php.ini was set to:

/home/vusers/domains/stadskleiv.no:/home/vusers/users/ketil:/tmp:/var/tmp:/usr/local/bin:/usr/local/lib/php:.

Which should be correct. But why does s9y think I have my installation /usr/local/apache2/htdocs ?

Posted: Fri Aug 18, 2006 9:27 pm
by garvinhicking
Hi!

Because /usr/local/apache2/htdocs seems to be in your include_path setting :)

Serendipity is coded to allow a "shared installation", thus it honours the include_path setting.

Best regards,
Garvin

Posted: Fri Aug 18, 2006 10:58 pm
by stadskle
I found it. Seems like my web-host has a configuration that changes the _SERVER["DOCUMENT_ROOT"] to that path on subdomains. Is there any way I can override this in the code?

Posted: Fri Aug 18, 2006 11:03 pm
by garvinhicking
Hi!

Uh, that sounds bad. You would need some patching in serendipity_config.inc.php, I guess.

Regards,
Garvin

Posted: Sat Aug 19, 2006 12:19 pm
by stadskle
It works now. A couple of ugly hacks setting the $_SERVER["DOCUMENT_ROOT"] variabel seemed to do the trick.

Thanks!