Running Mac OS X 10.5.8 with pre-installed PHP 5.2.11. Using Coda 1.6.10.
I write PHP files and then view them from a file, not from a server. This worked fine until I tried PHP. They do not work as a relative path, only as absolute from the root of the disk.
Is it possible to use expressions such as
include_once "common / header.php";
without specifying my entire file path as follows:
include_once "/ Volumes / Macintosh HD / Users / neil / Desktop / Website / ColoredLists_v1.0 / common / base.php";
where ColoredLists_v1.0 is the directory with all the website files. I tried solutions like adding _SERVER [DOCUMENT_ROOT] or dirname ( File ) in the file path, but this did not work as the variables were not set. Is there any simple way to do this or a configuration that I can change to look in a specific default directory instead of looking at the root of the disk? Currently displaying echo_include_path .:
When I include this line at the beginning of the script, it works:
set_include_path ('/ Volumes / Macintosh HD / Users / neil / Desktop / Website / ColoredLists_v1.0');
However, if I want to do this for all my scripts, I cannot make the change permanent. Even after I edited the Unix include_path in my php.ini, it does not work.
UPDATE: , sureshot - Apache . Mac, . httpd.conf, localhost, . , 80, , , . Coda "", url, . - , , .