PHP Errors Messages

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
User avatar
quadoc
Forum Contributor
Posts: 137
Joined: Fri Jul 01, 2005 5:33 pm
Location: Atlanta, GA

PHP Errors Messages

Post by quadoc »

I've the following error/message. Could someone explains to me what do they means? Thanks... :?

Warning: main(/Smarty/Smarty.class.php): failed to open stream: No such file or directory in /home/Project/public_html/schoolProject/setup.php on line 5

Fatal error: main(): Failed opening required '/Smarty/Smarty.class.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/Project/public_html/schoolProject/setup.php on line 5
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

means the file you're trying to include is not at the path you specified it does.
User avatar
quadoc
Forum Contributor
Posts: 137
Joined: Fri Jul 01, 2005 5:33 pm
Location: Atlanta, GA

Post by quadoc »

So the file Smarty.class.php is not found or the directory is not found?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

if you code looks like:

Code: Select all

require('/Smarty/Smarty.class.php');
then it's very likely the path that isn't correct.. a slash sends the search to the root directory, not your web site's "root"

try:

Code: Select all

require('../Smarty/Smarty.class.php');
or other combinations...

Code: Select all

require($_SERVER['DOCUMENT_ROOT'].'/Smarty/Smarty.class.php');
may work....
User avatar
quadoc
Forum Contributor
Posts: 137
Joined: Fri Jul 01, 2005 5:33 pm
Location: Atlanta, GA

Post by quadoc »

Thanks for the tips guys... :)
Post Reply