How to find active directory when calling PHP on command line?

From: Date: Thu, 02 Nov 2000 19:58:45 +0000
Subject: How to find active directory when calling PHP on command line?
Groups: php.general 
Request: Send a blank email to php-general+get-23446@lists.php.net to get a copy of this message
Hello, I have a PHP 4.0.3 script that I call from the command line, and pass it a filename. The script is located in '/usr/localbin/', and has '#! /usr/local/bin/php -q' on the first line. 'usr/local/bin' is in my $PATH, so the script can be executed anywhere in the directory tree. The problem is I have to pass the full filename (/var/test/ThisIsTheFile.txt) for the script to find it. If I'm in the '/var/test/' directory, and call 'myPHPScript ThisIsTheFile.txt', PHP can't find the file (it expects it to be in '/usr/local/bin' where the script is). How can I have PHP find the file in the current working directory? Is there a variable with this info in it? (I couldn't find it) Thanks, Chris

« previous php.general (#23446) next »