include_path error

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
Gyurci
Forum Newbie
Posts: 1
Joined: Sun Jan 08, 2006 6:07 am

include_path error

Post by Gyurci »

Hi Masters,
I am absolute beginner in PHP, and I would like to run a written web image gallery maker, but I get this error code:

Warning: main(include/Config.class.php): failed to open stream: No such file or directory in /usr/local/psa/home/vhosts/mydomain.biz/subdomains/elap/http docs/index.php on line 8

Fatal error: main(): Failed opening required 'include/Config.class.php' (include_path='.:/usr/local/psa/apache/lib/php') in /usr/local/psa/home/vhosts/mydomain.biz/subdomains/elap/http docs/index.php on line 8

I check the php server is running and the include_path is correct. I really don't know what is the problem, please help somebody for me!
:oops:


Thanks in advanced!


Gyurci
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

make sure you understand where php thinks you are running from and whatnot.

getcwd() will help you there.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

feyd is right as always

your relative path is most likely wrong

to avoid this you could a) make sure its not wrong ;) or b) use the absolute path. something like include '/home/user/path/to/file.php';
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Post by raghavan20 »

your current file path ....as it says from the error is...

Code: Select all

/usr/local/psa/home/vhosts/mydomain.biz/subdomains/elap/http docs/
make sure include/Config.class.php is like this
/usr/local/psa/home/vhosts/mydomain.biz/subdomains/elap/http docs/include
in real physical path


for traversing to another directory of the same level use soemthing like

Code: Select all

../peer_directory/file_name.ext
Post Reply