Goetz Lohmann wrote :

doc_root = /usr/local/www/htdocs

than maybe leave this blank !
No. In my case it's absolutely senseless to define doc_root in php.ini since there are many virtual servers in httpd.conf, each with its own root.

It's also the reason why I don't want Apache to get a working dir from the environment. So '.' and '..' don't mean anything either (for opening files), but that seems OK to me. Maybe your server got a working dir from its parent shell, so '.', '..', getcwd() and `pwd` work for you.

I didn't mention that I'm not the PHP programmer, but the Apache/PHP manager, and this is a problem encountered by the webmaster of one of the virtual servers when testing PHP 4.3.0. Their PHP application has several include directories and many include()s within included files. It's the reason why I'm looking for a way of getting their script working properly with as few modification as possible (I can modify php.ini or the server config).

if a file is parsed, all include files a relativ to this parsed file.
This seems true for 4.3.0, false for 4.2.1 (it's relative to the main script PHP_SELF).

PHP_SELF                   /phpinfo.php
I have printed PHP_SELF from within testinclude.php and inc1.php. In both cases, it's "/tests/testinclude.php"

echo exec('ls');
should print out not a empty string but
testinclude.php
and
echo exec('pwd');
should print "/usr/local/www/htdocs/tests"
Only if the server gets a working dir, which is not my case (ls and pwd return nothing, which is normal IMHO). Webmasters can't set it with chdir() since setting environment variables other than PHP_* is forbidden in the recommended php.ini for security reason.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to