NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
$_SERVER['PHP_SELF'] returns different values


Joined: 16 Dec 2010
Posts: 5
Reply with quote
Hello,
in my application I get

echo ($_SERVER['PHP_SELF']); the result is /scriptcase/app/SVSB/sc_login/sc_login.php

In Nuspere-debugger the Result is /sc_login/sc_login.php

I created a Nusphere-project and I'm using internal webserver from Nusphere
On the server I use apache with PHP 5.2 on Windows 2008/R2

What's going wrong ?

Best regards
View user's profileFind all posts by PfeifferSend private message
Guru master

Joined: 24 Jul 2009
Posts: 737
Reply with quote
The internal server is not the same as running PHP under Apache or IIS. I'm not familiar with the various differences, but there are a few mentioned in this forum. I think the internal server is more intended for running PHP rather than emulating a web server.

If you are developing applications for running on a web server, then I recommend you use Apache (my preference) or IIS on your development computer. That way you are developing using something that is very similar or identical to the web server.
View user's profileFind all posts by plugnplaySend private message


Joined: 17 Aug 2012
Posts: 1
Reply with quote
Operating system: Windows XP Pro
PHP version: 4.3.3
PHP Bug Type: PHP options/info functions
Bug description: $_SERVER['PHP_SELF'] fails to return a value (broken since 4.3.2)

Description:
------------
Running the code (below) on 4.3.2 and above (I've checked it on 4.3.2,
4.3.3RC1 to RC4 and 4.3.3) fails to produce any output. On 4.3.0 and 4.3.1
it works fine.

For testing I am changing over the PHP versions just by renaming the
c:\php dir (from c:\php431, c:\php432, c:\php433-1 etc). Nothing in the
application changes and I am using one common php.ini file for all php
versions, ONLY the php version itself is changed. All PHP versions are the
standard Win32 Binaries with no modifications.

In php.ini register globals are OFF and the only other changes are to turn
a few extensions on (GD and DBX).

I am using the Xitami web server version 2.4d9 from
on a Compaq Evo system (Celeron 1.8MHz, 128MB RAM, WinXPPro).

I've noticed that this (or similar) bugs have been reported recently (e.g.
#24979) but dismissed by stating that it works with the latest CVS etc. If
this is the case when this bug report is checked then I would suggest that
there is something else going on here that is not showing up on your test
systems. It is ALWAYS reproducible here. Note that using
$_SERVER['SCRIPT_NAME'] DOES work (but my code tends to use
$_SERVER['PHP_SELF'] and why should I change?).



Reproduce code:
---------------
<?php
print "self = " . $_SERVER['PHP_SELF'];
?>

Expected result:
----------------
With the above code in the file test.php in the web server's document
root:

self = /test.php


Actual result:
--------------
self =

qualitywebprogrammers.com/services.php
View user's profileFind all posts by redfeilds18Send private message
$_SERVER['PHP_SELF'] returns different values
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic