#12310 [Com]: $SCRIPT_FILENAME

From: Date: Wed, 30 Oct 2002 16:59:12 +0000
Subject: #12310 [Com]: $SCRIPT_FILENAME
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-23731@lists.php.net to get a copy of this message
ID: 12310 Comment by: php-bugs@b-a-l-u.de Reported By: michael@frifra.de Status: Bogus Bug Type: Variables related Operating System: WinNT IIS PHP Version: 4.0.6 New Comment: This is more than a year old, but I think I might add this thought, because I struggled over a similar problem and found this bug with no real result - perhaps it helps others that search for a problem like this. SCRIPT_FILENAME is an Apache Environment-Variable (at least phpinfo() lists it there. And it does not exist on IIS-systems. SCRIPT_NAME seems to be known by both systems. (There are / were other bugs with PHP-Versions that have the path to php.exe in it. Balu Previous Comments: ------------------------------------------------------------------------ [2001-07-22 21:49:37] cynic@php.net Please, take this where it belongs: php-general@lists.php.net ------------------------------------------------------------------------ [2001-07-22 21:35:14] cnewbill@php.net I'm assuming you want to be able to call these includes, and you think you need to know the path? IMO, there is a much cleaner way that you can use regardless of your current working directory. Create a directory where all your scripts will go, for example C:\Inetpub\php\. Modify your include_path to include our new directory C:\Inetpub\php. Move your "inc/" directory to this new directory. Now your code can be <?php include("inc/navi_d.inc"); ?> no matter what directory you are in. You just need to make sure you have your path setup in the order you want it processed in, otherwise if you have an inc/navi_d.inc in your current working dir it will use that one first. Which is also good in some cases. I've honestly never used $SCRIPT_FILENAME, I've always used $PHP_SELF or one of the HTTP_SERVER_VARS. -Chris ------------------------------------------------------------------------ [2001-07-22 21:24:03] michael@frifra.de Hi i just made a page with <?php phpinfo(); ?> http://frifra.dtdns.net:8082/informatik/test.php ------------------------------------------------------------------------ [2001-07-22 20:35:21] andy@php.net make sure you have a big mailbox if you subscribe to this mailing list. You get lots of messages... ------------------------------------------------------------------------ [2001-07-22 20:30:59] cynic@php.net One last remark before I definitely leave this PR: Michael, you might also want to subscribe to php-general@, that can be done by sending an empty email to php-general-subscribe@lists.php.net ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/12310 -- Edit this bug report at http://bugs.php.net/?id=12310&edit=1

« previous php.bugs (#23731) next »