View Full Version : Safe Mode and pwd
nurelm
04-03-1999, 09:43 AM
What's a good way to figure out the full path to your current script? I'd like it so I can figure out the path what what I want to require from scripts running in different directories.
Since the servers have the 'safe mode' option on for php, you can't do $path = exec('/bin/pwd') and the built-in $PHP_SELF doesn't give the full path.
Terra
04-03-1999, 02:55 PM
Take a look at the 'phpinfo()' results... You will see the doc_root set at /big/dom...
I believe in this case to just use:
xnurelm/www/myinclude/myfile.inc
or something similiar...
I have also setup a 'safe_mode_exec_dir' /big/dom/PHP_bin that I have placed 'ls' and 'pwd' into... You can exec these if needed...
--
Terra
sysAdmin
FutureQuest
nurelm
04-03-1999, 03:25 PM
Perfect, pwd is something I couldn't figure out how to make php do without an external call.
Using a pwd, I can include a file the same way on my developement platform as on the server, so no changes are needed after an upload.
Thanks!
vBulletin® v3.6.8, Copyright ©2000-2008, Jelsoft Enterprises Ltd.