Trying to use include_path without success

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
atm
Forum Newbie
Posts: 5
Joined: Wed Oct 29, 2008 1:24 pm

Trying to use include_path without success

Post by atm »

Hello there,

I have a library that I am hoping to use across several sites on my server.

phpinfo() reports:

Local Value Master Value
include_path .:/usr/share/php:/usr/share/pear .:/usr/share/php:/usr/share/pear


So to try the most basic include, I created:

test.php in /usr/share/php

Code: Select all

 
<?
echo "INCLUDED TEST";
?>
 
Then in my site, I created:

mytest.php

Code: Select all

 
<?
include ('test.php');
?>
 
Hoping this would go looking in my include path for the file but my result is this:

Code: Select all

 
<?
Warning: include(test.php) [function.include]: failed to open stream: No such file or directory in /home/mysite/public_html/temp/mytest.php on line 2
 
Warning: include() [function.include]: Failed opening 'test.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /home/mysite/public_html/temp/mytest.php on line 2
?>
 

What am I doing wrong?
atm
Forum Newbie
Posts: 5
Joined: Wed Oct 29, 2008 1:24 pm

Re: Trying to use include_path without success

Post by atm »

Nevermind I found the include directory also must be in open_basedir

:drunk:
Post Reply