You need to log in before you can comment on or make changes to this bug.
Windows 2000 Server PHP 4.3.3 chameleon.php line 160 $GLOBALS['gszAppPath'] = dirname( $_SERVER['SCRIPT_FILENAME'] )."/"; $_SERVER['SCRIPT_FILENAME'] did not exist in the $_SERVER array when print_r'ed. Resolution: $_SERVER['SCRIPT_NAME'] existed. Perform check for isset($_SERVER['SCRIPT_FILENAME']) ?
Fixed. I added a check before using SCRIPT_FILENAME. Then if not set it use SCRIPT_NAME.
Actually, it needs to be set to $_SERVER['PATH_TRANSLATED'] instead of $_SERVER['SCRIPT_NAME'] after further research. As well, it's not known how other webservers under different OS' use the $_SERVER var.
Unfortunately PATH_TRANSLATED is only available in PHP 4.3.X and up....
Oh... It looks like it is. I've made a test on a old PHP and I got PATH_TRANSLATED. Someone in the code added a test to prevent access that var if not greater than 4.3.X. Not sure why.
Ok. I fixed the problem in CVS. It's now using PATH_TRANSLATED. I'm leaving the bug open for a few days to make sure the test about version was useless. Any comments ?
On my system phpinfo reports that I have no PATH_TRANSLATED ... but I do have ORIG_PATH_TRANSLATED. http://ca.php.net/manual/en/reserved.variables.php#reserved.variables.server $_SERVER is an array containing information such as headers, paths, and script locations. The entries in this array are created by the webserver. There is no guarantee that every webserver will provide any of these; servers may omit some, or provide others not listed here. That said, a large number of these variables are accounted for in the CGI 1.1 specification, so you should be able to expect those. And from the CGI spec: PATH_TRANSLATED The server provides a translated version of PATH_INFO, which takes the path and does any virtual-to-physical mapping to it. So it should be there, but in my case it is not.
Ok. Me and Bill have been able to reproduce the problem. When PATH_TRANSLATED is not set we check for ORIG_PATH_TRANSLATED. And it fixed the problem. Paul, can you try it on you system to make sure it's working and mark the bug fixe dif so ?
updated version to 1.99
yes this seems to work.
I have just verified that ORIG_PATH_TRANSLATED exists on Win2K/XP under both IIS and Apache $_SERVER. This is sufficient for Windows OS.
Jay I would like you to show me how you verified this, thanks :)
Chris, I ran PHPInfo() ... it will list all the $_SERVER variables available on that machine under that webserver.
verified, using beta 2 2004-06-20 and phpinfo() SERVER["ORIG_PATH_TRANSLATED"] D:\\ms4w\\Apache\\htdocs\\phpinfo.php
Verified on Fedora Core 1 Chameleon 20040625. "PATH_TRANSLATED" is defined instead of "ORIG_PATH_TRANSLATED". So by testing on Windows and Linux, we tested both possibilities. _SERVER["PATH_TRANSLATED"] /var/www/html/nsavard/tests/phpinfo.phtml