Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have the documents at in /home/www/ running on Debian Squeeze.


In the php.ini I've uncommented and changed to:

include_path =".:/home/www/"

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/ on line 2

Fatal error: require_once() [function.require]: Failed opening required '/php/include_me.php' (include_path='.:/home/www/') in /home/www/ 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?

share|improve this question
up vote 1 down vote accepted

That is wrong (in your particular case). Right now you've told PHP to search for include_me.php file in /php/ folder (yep, /php/ and not /home/www/ as you expecting as you have provided absolute and not relative path).

Remove leading slash and enjoy:


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.