I could not get my include_path to work. I read the manual and discovered it doesn't work if you start in safe_mode. I want it to work. I checked my php.ini and it isn't in safe_mode.
include_path = ".:/php/includes"
I'm trying to understand this. I have a mac with leopard. My htdocs root is
/Library/webserver/documents. In that directory I have a php script that calls the Smarty.class.php file testsmarty.php. In the documents directory I have a php/includes directory with the Smarty.class.php in includes folder.
Shouldn't this work.
this is the error:
Warning: require_once(Smarty.class.php) [function.require-once]: failed to open stream: No such file or directory in /Library/WebServer/Documents/testsmarty.php on line 4
Fatal error: require_once() [function.require]: Failed opening required 'Smarty.class.php' (include_path='.:') in /Library/WebServer/Documents/testsmarty.php on line 4
this is the php file:
<?php
//define('SMARTY_DIR', '/usr/lib/php/Smarty-2.6.26/libs/');
//require_once(SMARTY_DIR . 'Smarty.class.php');
require_once('Smarty.class.php');
$smarty = new Smarty();
?>
I can get it to work with the defined constant SMARTY_DIR but I am really curious about why I can't get the include file to work? I also couldn't get it when I used the full path
include_path=".:/Library/WebServer/documents/php/includes"
or
include_path="./Library/WebServer/documents/php/includes"
of course with the class file in the includes directory.
why can't I get it to work?