Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » Changing $_SERVER values on the fly.(I'm trying to change editor $_SERVER global variables during debug execution.)
Changing $_SERVER values on the fly. [message #768560] Tue, 20 December 2011 11:20 Go to next message
cluesome Missing name is currently offline cluesome Missing nameFriend
Messages: 12
Registered: November 2010
Location: Edinburgh, Scotland
Junior Member
I'm creating a website app using PDT and xdebug with a virtual host set up for the development.
I'm pulling info. from the $_SERVER global.

In the Variables tab I see $_SERVER['REMOTE_ADDR'] is set '127.0.0.1' due to my set-up.

I'd like to change this on the fly to simulate real-world IP hits for testing. I can change it programatically by adding code to my source but that defeats the purpose; I'm trying to use the Change Value... right click option. When I do that I get the message:

"An exception occurred attempting to change the variable value.
Reason:
Program under debug rejected value change."

Is it possible? Please help.

[Updated on: Tue, 20 December 2011 18:43]

Report message to a moderator

Re: Changing $_SERVER values on the fly. [message #769429 is a reply to message #768560] Thu, 22 December 2011 02:43 Go to previous messageGo to next message
Toshihiro Izumi is currently offline Toshihiro IzumiFriend
Messages: 360
Registered: July 2009
Location: Japan
Senior Member
It is impossible because of a bug of pdt.

Try logging for xdebug. (xdebug.remote_log=<filename> in php.ini)
You may get something like this,
Quote:
<- property_set -i 12 -t string -n $_SERVER['REMOTE_ADDR'] -d -1 -l 16 -- MTI3LjAuMC4xMjg=->
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug"
command="property_set" transaction_id="12" status="break" reason="ok">
<error code="301"><message><![CDATA[stack depth invalid]]></message></error>
</response>

"stack depth invalid" means the argument with "-d" (-1) is incorrect. This is a bug of pdt.
Re: Changing $_SERVER values on the fly. [message #769884 is a reply to message #769429] Thu, 22 December 2011 21:03 Go to previous messageGo to next message
cluesome Missing name is currently offline cluesome Missing nameFriend
Messages: 12
Registered: November 2010
Location: Edinburgh, Scotland
Junior Member
Thanks for that. I'll give it a go and see what I get.

I've read around that PDT isn't getting much development attention. I don't suppose its worth raising a bug report, you reckon?
Re: Changing $_SERVER values on the fly. [message #769903 is a reply to message #769884] Thu, 22 December 2011 21:58 Go to previous messageGo to next message
cluesome Missing name is currently offline cluesome Missing nameFriend
Messages: 12
Registered: November 2010
Location: Edinburgh, Scotland
Junior Member
Hi Toshihiro,

I put this in php.ini:

[xdebug]
xdebug.remote_log=/opt/local/apache2/logs/xdebug_log

I created the file using:

> sudo touch debug_log

I stopped and started the web server and restarted Eclipse, then ran my script under PDT.

Result: no output to the log file.

Please tell me what I'm doing wrong.
Re: Changing $_SERVER values on the fly. [message #769966 is a reply to message #769903] Fri, 23 December 2011 01:42 Go to previous messageGo to next message
Toshihiro Izumi is currently offline Toshihiro IzumiFriend
Messages: 360
Registered: July 2009
Location: Japan
Senior Member
/opt/local/apache2/logs folder may not have permission against xdebug.
Try /tmp (or such) folder.
Re: Changing $_SERVER values on the fly. [message #770198 is a reply to message #769966] Fri, 23 December 2011 15:55 Go to previous messageGo to next message
cluesome Missing name is currently offline cluesome Missing nameFriend
Messages: 12
Registered: November 2010
Location: Edinburgh, Scotland
Junior Member
This is my output.
It looks very similar to what you said:

<- property_set -i 70 -t string -n $_SERVER['REMOTE_ADDR'] -d -1 -l 16 -- NjkuMTIyLjAuMQ==->
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug"
command="property_set" transaction_id="70" status="break" reason="ok">
<error code="301"><message><![CDATA[stack depth invalid]]></message></error>
</response>
Re: Changing $_SERVER values on the fly. [message #773684 is a reply to message #770198] Mon, 02 January 2012 09:33 Go to previous messageGo to next message
cluesome Missing name is currently offline cluesome Missing nameFriend
Messages: 12
Registered: November 2010
Location: Edinburgh, Scotland
Junior Member
I assume bugs #358928, #33057 and #202439 all deal with the same issue so I'll not raise another.
Re: Changing $_SERVER values on the fly. [message #773963 is a reply to message #773684] Tue, 03 January 2012 01:05 Go to previous message
Toshihiro Izumi is currently offline Toshihiro IzumiFriend
Messages: 360
Registered: July 2009
Location: Japan
Senior Member
As for bug#202439, it is an issue of the Expressions View.
As for bug#358928, it is JSDT, not PDT.
No relations to the issue of this thread.

Your new bug report will be appreciated, maybe. But don't expect it will be resolved someday. (I don't mean pdt isn't getting much development attention. It is actively developed.)

BTW, I don't recommend but there is an unofficial patch for pdt 3.0.0 only.
http://sourceforge.jp/users/atlanto/pf/eclipse/files/?id=435
(pdt_tools.feature_patch.pdt.3.0.0.v20111225.zip)
It solves the issue of this thread.
See also pdt_tools.feature_patch.pdt.html, though it is Japanese.

--
Toshihiro Izumi
http://blog.goo.ne.jp/atlanto
Previous Topic:Checking out multiple SVN locations to single project
Next Topic:Editor stop working
Goto Forum:
  


Current Time: Tue Mar 19 10:59:43 GMT 2024

Powered by FUDForum. Page generated in 0.02382 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top