Re: [PHP] $_SERVER["PATH_TRANSLATED"] returns empty string
Is $_SERVER["SCRIPT_FILENAME"] the information you need? (on apache 2.0, php 4.2.2) Kind regards, Dries Verachtert On Fri, 2002-12-20 at 15:40, Robert Nedbal wrote: > On Wed, 18 Dec 2002, Chris Hewitt wrote: > > Robert Nedbal wrote: > > >So should I try to use apache 1.x instead of apache2? > > > > > Pass on that, I have no experience of Apache 2, but I do not think it is > > intended for production yet. Looking at phpinfo() on my computer here > > (GNU/Linux RedHat 7.3 PHP 4.1.2 and Apache 1.3.23) in the "PHP > > Variables" at the bottom shows "_SERVER["PATH_TRANSLATED"} as having the > > value "/var/www/html/phpinfo.php", which is correct. If you do not get a > > value by looking at phpinfo() then I suggest there must be some sort of > > bug. You could try searching the bug list, otherwise maybe going back to > > Apache 1.3.x is a good idea. > > > > I tried Apache 1.3.x and it works. I tested phpinfo() on both systems and > there are results: > _SERVER["PATH_TRANSLATED"] > Apache 1.3.27 + php-4.2.3: correct value > Apache 2.0.40 + php-4.2.2: empty string (not even shown by phpinfo()) > > I think that there is not big difference between php-4.2.2 and php-4.2.3, > at least in release notes for php-4.2.3 was nothing about _SERVER > variables. > > Should I add record about this to http://bugs.php.net/ ? > > > Hope this helps. > > Yes, thank you very much. > > Best regards, > Robert > > > > > Chris > > > > > > -- > > Robert Nedbal - Czech Technical University in Prague, Czech Republic > email: [EMAIL PROTECTED] http://www.sh.cvut.cz/~robik/ > /* Debuggers are evil. Never ever trust them. */ > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $_SERVER["PATH_TRANSLATED"] returns empty string
On Wed, 18 Dec 2002, Chris Hewitt wrote: > Robert Nedbal wrote: > >So should I try to use apache 1.x instead of apache2? > > > Pass on that, I have no experience of Apache 2, but I do not think it is > intended for production yet. Looking at phpinfo() on my computer here > (GNU/Linux RedHat 7.3 PHP 4.1.2 and Apache 1.3.23) in the "PHP > Variables" at the bottom shows "_SERVER["PATH_TRANSLATED"} as having the > value "/var/www/html/phpinfo.php", which is correct. If you do not get a > value by looking at phpinfo() then I suggest there must be some sort of > bug. You could try searching the bug list, otherwise maybe going back to > Apache 1.3.x is a good idea. > I tried Apache 1.3.x and it works. I tested phpinfo() on both systems and there are results: _SERVER["PATH_TRANSLATED"] Apache 1.3.27 + php-4.2.3: correct value Apache 2.0.40 + php-4.2.2: empty string (not even shown by phpinfo()) I think that there is not big difference between php-4.2.2 and php-4.2.3, at least in release notes for php-4.2.3 was nothing about _SERVER variables. Should I add record about this to http://bugs.php.net/ ? > Hope this helps. Yes, thank you very much. Best regards, Robert > > Chris > > -- Robert Nedbal - Czech Technical University in Prague, Czech Republic email: [EMAIL PROTECTED] http://www.sh.cvut.cz/~robik/ /* Debuggers are evil. Never ever trust them. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $_SERVER["PATH_TRANSLATED"] returns empty string
Robert Nedbal wrote: Are you implying that it used to work on another computer, or before an upgrade? If so, can you compare the php.ini files? Otherwise maybe its a bug (php with Apache2 I don't think is stable yet). HTH Chris Yes exactly, it's working on our production server (apache 1.x, php-4.0.6). On our test server it's _not_ working (apache 2.0.40, php-4.2.2). I think I'd check the release notes for 4.2.2 first to see if there is any change to account for this. /etc/php.ini file is identical on both systems. Just being careful (as you compiled from source), does phpinfo() on both systems show php.ini located in /etc? So should I try to use apache 1.x instead of apache2? Pass on that, I have no experience of Apache 2, but I do not think it is intended for production yet. Looking at phpinfo() on my computer here (GNU/Linux RedHat 7.3 PHP 4.1.2 and Apache 1.3.23) in the "PHP Variables" at the bottom shows "_SERVER["PATH_TRANSLATED"} as having the value "/var/www/html/phpinfo.php", which is correct. If you do not get a value by looking at phpinfo() then I suggest there must be some sort of bug. You could try searching the bug list, otherwise maybe going back to Apache 1.3.x is a good idea. Hope this helps. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $_SERVER["PATH_TRANSLATED"] returns empty string
On Wed, 18 Dec 2002, Chris Hewitt wrote: > Robert Nedbal wrote: > > >Hi, > >thanks for your reply. But changing source code in my setup is not a long > >term option. My problem is that $_SERVER["PATH_TRANSLATED"] gives me > >empty string. > > > >Does anybody know how to fix my PHP installation, so > >$_SERVER["PATH_TRANSLATED"] will give me correct file path? > > > >Best regards, > >Robert > > > Are you implying that it used to work on another computer, or before an > upgrade? If so, can you compare the php.ini files? Otherwise maybe its a > bug (php with Apache2 I don't think is stable yet). > > HTH > Chris Yes exactly, it's working on our production server (apache 1.x, php-4.0.6). On our test server it's _not_ working (apache 2.0.40, php-4.2.2). /etc/php.ini file is identical on both systems. So should I try to use apache 1.x instead of apache2? Best regards, Robert -- Robert Nedbal - Czech Technical University in Prague, Czech Republic email: [EMAIL PROTECTED] http://www.sh.cvut.cz/~robik/ /* Debuggers are evil. Never ever trust them. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $_SERVER["PATH_TRANSLATED"] returns empty string
Robert Nedbal wrote: Hi, thanks for your reply. But changing source code in my setup is not a long term option. My problem is that $_SERVER["PATH_TRANSLATED"] gives me empty string. Does anybody know how to fix my PHP installation, so $_SERVER["PATH_TRANSLATED"] will give me correct file path? Best regards, Robert Are you implying that it used to work on another computer, or before an upgrade? If so, can you compare the php.ini files? Otherwise maybe its a bug (php with Apache2 I don't think is stable yet). HTH Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $_SERVER["PATH_TRANSLATED"] returns empty string
Hi, thanks for your reply. But changing source code in my setup is not a long term option. My problem is that $_SERVER["PATH_TRANSLATED"] gives me empty string. Does anybody know how to fix my PHP installation, so $_SERVER["PATH_TRANSLATED"] will give me correct file path? Best regards, Robert On Wed, 18 Dec 2002, Wico de Leeuw wrote: > Maybe basename($_SERVER['SCRIPT_NAME']); > > At 14:10 18-12-02 +0100, Robert Nedbal wrote: > >Hi, > >I'm having problems with my PHP installation. When I try to get real path > >to my script by using $_SERVER["PATH_TRANSLATED"], I receive empty string. > > > >$_SERVER["PATH_TRANSLATED"] empty string (why?) > >$_SERVER["PHP_SELF"] works as expected (ok) > >$_SERVER["DOCUMENT_ROOT"]works as expected (ok) > > > >OS: RedHat Linux 8.0 > >Apache: httpd-2.0.40-11 > >PHP: php-4.2.2-8.0.5 (recompiled from source) > > > >Any ideas how to fix this? > > > >Best regards, > >Robert > > > >PS: When replaying please CC me as I'm not subscribed to this list, > >thanks. > > > >-- > > > >Robert Nedbal - Czech Technical University in Prague, Czech Republic > >email: [EMAIL PROTECTED] http://www.sh.cvut.cz/~robik/ > > /* Debuggers are evil. Never ever trust them. */ > > > > > > > >-- > >PHP General Mailing List (http://www.php.net/) > >To unsubscribe, visit: http://www.php.net/unsub.php > > -- Robert Nedbal - Czech Technical University in Prague, Czech Republic email: [EMAIL PROTECTED] http://www.sh.cvut.cz/~robik/ /* Debuggers are evil. Never ever trust them. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $_SERVER["PATH_TRANSLATED"] returns empty string
Maybe basename($_SERVER['SCRIPT_NAME']); At 14:10 18-12-02 +0100, Robert Nedbal wrote: Hi, I'm having problems with my PHP installation. When I try to get real path to my script by using $_SERVER["PATH_TRANSLATED"], I receive empty string. $_SERVER["PATH_TRANSLATED"] empty string (why?) $_SERVER["PHP_SELF"] works as expected (ok) $_SERVER["DOCUMENT_ROOT"]works as expected (ok) OS: RedHat Linux 8.0 Apache: httpd-2.0.40-11 PHP: php-4.2.2-8.0.5 (recompiled from source) Any ideas how to fix this? Best regards, Robert PS: When replaying please CC me as I'm not subscribed to this list, thanks. -- Robert Nedbal - Czech Technical University in Prague, Czech Republic email: [EMAIL PROTECTED] http://www.sh.cvut.cz/~robik/ /* Debuggers are evil. Never ever trust them. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php