PHP include_path doesn't work
Posted
by
50ndr33
on Server Fault
See other posts from Server Fault
or by 50ndr33
Published on 2012-06-07T15:36:30Z
Indexed on
2012/06/07
16:42 UTC
Read the original article
Hit count: 276
I have the documents at http://www.example.com/
in /home/www/example.com/www
running on Debian Squeeze.
/home/www/example.com/
www/
index.php
php/
include_me.php
In the php.ini I've uncommented and changed to:
include_path =".:/home/www/example.com"
In a script index.php in www, I have require_once("/php/include_me.php")
. The output I am getting from PHP is:
Warning: require_once(/php/include_me.php) [function.require-once]: failed to open stream: No such file or directory in /home/www/example.com/www/index.php on line 2
Fatal error: require_once() [function.require]: Failed opening required '/php/include_me.php' (include_path='.:/home/www/example.com') in /home/www/example.com/www/index.php on line 2
As you can see, the include-path is set correctly according to the error. But if I do require_once("../php/include_me.php");
, it works. Therefore, something has to be wrong with the include-path.
Does anyone know what I can do to fix it?
© Server Fault or respective owner