hi there, I'm going through a book called Beginning PHP 5 and MySQL E-Commerce but I'm having some problems early.
I'm running PHP 5 and MySQL 4 using MAMP, on Mac OS X.
In one file, called config.inc.php, I define several variables, including:
define ("SITE ROOT",dirname(dirname(__FILE__)));
But I'm getting this message:
Warning: main(SITE_ROOT/libs/smarty/Smarty.class.php) [function.main]: failed to open stream: No such file or directory in /Applications/MAMP/htdocs/tshirtshop/include/setup_smarty.php on line 3
Fatal error: main() [function.require]: Failed opening required 'SITE_ROOT/libs/smarty/Smarty.class.php' (include_path='.:/Applications/MAMP/bin/php5/lib/php') in /Applications/MAMP/htdocs/tshirtshop/include/setup_smarty.php on line 3
So, I tried changing the define lines to use absolute paths, like this:
define ("SITE ROOT",'http://localhost:8888/tshirtshop');
I did this to al lthe define lines in config.inc.php, but I still get an error message:
Fatal error: Class 'Smarty' not found in /Applications/MAMP/htdocs/tshirtshop/include/setup_smarty.php on line 10
which seems to be talking about this line:
class Page extends Smarty
Can anybody please help?the problem was resolved when it was pointed out to me that I had a space where there should not have been one:
define ("SITE ROOT",dirname(dirname(__FILE__)));
should have been:
define ("SITE_ROOT",dirname(dirname(__FILE__)));
I'm running PHP 5 and MySQL 4 using MAMP, on Mac OS X.
In one file, called config.inc.php, I define several variables, including:
define ("SITE ROOT",dirname(dirname(__FILE__)));
But I'm getting this message:
Warning: main(SITE_ROOT/libs/smarty/Smarty.class.php) [function.main]: failed to open stream: No such file or directory in /Applications/MAMP/htdocs/tshirtshop/include/setup_smarty.php on line 3
Fatal error: main() [function.require]: Failed opening required 'SITE_ROOT/libs/smarty/Smarty.class.php' (include_path='.:/Applications/MAMP/bin/php5/lib/php') in /Applications/MAMP/htdocs/tshirtshop/include/setup_smarty.php on line 3
So, I tried changing the define lines to use absolute paths, like this:
define ("SITE ROOT",'http://localhost:8888/tshirtshop');
I did this to al lthe define lines in config.inc.php, but I still get an error message:
Fatal error: Class 'Smarty' not found in /Applications/MAMP/htdocs/tshirtshop/include/setup_smarty.php on line 10
which seems to be talking about this line:
class Page extends Smarty
Can anybody please help?the problem was resolved when it was pointed out to me that I had a space where there should not have been one:
define ("SITE ROOT",dirname(dirname(__FILE__)));
should have been:
define ("SITE_ROOT",dirname(dirname(__FILE__)));