Entry
Does require() use file system paths or web server paths?
Jul 12th, 1999 01:49
Nathan Wallace, Rasmus Lerdorf
require() uses file-system paths, not web server paths. So
require("/phpinc/vars.php3");
will look for the file vars.php3 in the directory /phpinc/ on your
server. It does not look for http://www.yourdomain.com/phpinc/vars.php3
The best approach is probably to define your include_path. For example:
In your httpd.conf file, put this:
php3_include_path .:/some/path/phpinc
Then simply do:
require "vars.php3"
and PHP will first look for this file in . and then in /some/path/phpinc