Zend Debugger Connectivity Issue
Last Post 03 Sep 2013 09:04 PM by Alex Krashevsky. 23 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Page 1 of 212 > >>
Author Messages
Alex Krashevsky
New Member
New Member
Posts:27

--
24 Nov 2012 02:27 PM

Hello Everyone,

I am trying to debug a PHP script that is published on an IBM i server using Zend Debugger in Zend Studio installation. I am using Zend Studio 9.0.3, and on the IBM i side, it is Zend Server 5.6.0 and PHP 5.3.8.

I use a sample script from recent Mike Pavlak's article. So I've deployed it on the IBM i and run it as <...>:10088/news201210/wsform1.php without a problem.

To get my debug started, I do the following.

1. Go to Window/Preferences/PHP/PHP Servers/New. For the Server, I specify Base URL as http:/<...>/:10088. I map the path as /News201210 on the server vs. /News201210 in Workspace. For Zend Server, I check "Enable Zend Server integration" and uncheck Use Default for Zend Server URL; type /ZendServer for URL Suffix and 10088 for Port Number. 

2. Go to Window/Preferences/PHP/Debug/Installed Debuggers. Click on Configure for Zend Debugger. Once there, I leave there Debug Port 10137, and type <...>,127.0.0.1 in Client Host/IP. Also keep dummy.php as Dummy File Name.

3. Go to Run/Debug Configurations. There, I select my PHP Server, check Break at First Line, specify /News201210/WSForm1.php, uncheck URL Auto Generate, click on Debug. In the Debug perspective, the browser window yields no response. When the mouse is hovered over the address window, the following is seen there.

http://<...>:10088/News201210/WSForm1.php?debug_host=<...>%2C127.0.0.1&debug_fastfile=1&start_debug=1&debug_port=10137&use_remote=1&original_url=http%3A%2F%2F<...>%3A10088%2FNews201210%2FWSForm1.php&send_sess_end=1&debug_stop=1&debug_start_session=1&debug_no_cache=1353782960899&debug_session_id=1003 

Somebody also suggested that I use the IP address returned by whatismyip.com in 2., instead of ipconfig. When I do that, the browser window instantly returns the following.

Failed to connect to host <...>. Failed to connect to host '127.0.0.1'

Note that the both client host IP addresses are listed under "Current list of allowed hosts" in Server Setup/Debugger in my Zend Server.

 

What may I still be missing...?

 

Ringer
Veteran Member
Veteran Member
Posts:1765
Avatar

--
26 Nov 2012 04:13 PM
I can tell you how I have it configured on my PC, if that helps. I've had issues like this before and it's usually a malformed URL where I can type the URL directly in the browser and it works fine but not from the Zend Studio debugger.

1.
The Path on Server is the document root on the IFS so something like /www/zendsvr/htdocs .
The Local path is the project path on your zend studio so something like /zendsvr .
This is NOT the complete Local path but Zend Studio knows the full local path from the workspace when the project was created.

2.
In Configure Zend Debugger, type in your local Host/client (Zend Studio) IP address. Example: 10.xxx.xxx.xxx . Is that needed? Not sure, again, works for me.
Does dummy.php actually exist in document root in the /www/zendsvr/htdocs IFS folder? It must. Are you *authorized* to run it? Do a WRKLNK 9=Authority.
Mine is a very simple script.
echo 'In ', __FILE__ ;

Check your Zend debugger settings on the IFS:
In /usr/local/zendsvr/etc/php.ini
[Zend]
zend.install_dir=/usr/local/zendsvr
zend.conf_dir=/usr/local/zendsvr/etc
zend.ini_scandir=conf.d

Then in /usr/local/zendsvr/etc/conf.d/debugger.ini
zend_debugger.allow_hosts=127.0.0.1/32,10.0.0.0/8, etc

I believe you have to restart Zend Server for this to take effect. You can view what is currently in effect with phpinfo( ) or http://smcdvd:10088/ZendServer/ .
GO ZENDSVR/ZSMENU and drill down to restart.

3.
No response? Check ‘/usr/local/zendsvr/var/log/php.log‘ for any errors.

The mapping is like this:
File is your Local (Zend Studio) file. /zendsvr/YourScript.php
The URL is the file on IFS. http://your400:10088/YourScript.php

If you click on "Test Debugger" on the Server tab, and dummy.php does any output, you should see this error in /www/zendsvr/logs/error_log.Q112112600 so you know it did connect for sure.
[Mon Nov 26 15:35:46 2012] [warn] Cannot send HTTP response errno=3455
[Zend Debugger] Cannot send message

Here are some useful links I found a while back:

http://kb.zend.com/index.php?View=e...ntryID=434
http://kb.zend.com/index.php?View=e...ntryID=421

Good luck!

Chris Ringer
Alex Krashevsky
New Member
New Member
Posts:27

--
26 Nov 2012 08:30 PM

Thanks Chris.

Double checked everything, wasn't able to find a discrepancy.

The log file /www/zendsvr/logs/error_log.Q112112600 displays the following.

[Mon Nov 26 21:03:40 2012] [error] Can not read response from /usr/local/ZendSvr/bin/php-cgi.bin (0.0) - [3447] A remote host did not respond within the timeout period.

/usr/local/zendsvr/var/log/php.log renders the following.

PHP Fatal error:  Maximum execution time of 60 seconds exceeded in Unknown on line 0


Guess that's not too much so far, will try and dig it deeper... :)





Ringer
Veteran Member
Veteran Member
Posts:1765
Avatar

--
27 Nov 2012 06:05 AM

Does debug start up and break on the first line of our php script?

And as a test, add this to the top of your PHP script to give it max time to run, to see if you get a

normal response back: set_time_limit(0) ;

How are you sync'ing your local php script source and your IFS source code? Upload on save? Upload manually?

http://php.net/manual/en/function.s...-limit.php

Chris Ringer
Alex Krashevsky
New Member
New Member
Posts:27

--
27 Nov 2012 06:24 AM
No, it doesn't start up, and the break on the first line is never encountered.

It's upload on save, and I can tell it's working.

Will try and play with set_time_limit() tonight...

Thanks!
Ringer
Veteran Member
Veteran Member
Posts:1765
Avatar

--
27 Nov 2012 12:34 PM
I don't see anything obviously wrong then. You might go to the debug perspective, click on the "Debug URL" icon, type in the URL and see if debug starts that way successfully. Or restart the Zend server if you can.

Chris Ringer
Ringer
Veteran Member
Veteran Member
Posts:1765
Avatar

--
27 Nov 2012 01:01 PM
If it helps any, setting up Zend Debugger: http://forums.zend.com/viewtopic.php?f=59&t=962

Chris Ringer
Alex Krashevsky
New Member
New Member
Posts:27

--
27 Nov 2012 07:24 PM
Debug URL results in the same error as Debug Configuration run. When I am in the debug perspective and run the file from Run Configurations, it works alright, same as from regular browser. That tells me that the problem is almost positively with the server somehow failing to talk back to the client host.

Another observation: when I configure the debugger with ClientHost/IP obtained from whatismyip.com it still doesn't work but gives a different error from when the IP is from ipconfig ("Failed to connect to host" vs. the timeout error).

Which client IP did you use for your successful debugger configuration (from ipconfig or something else)?
Ringer
Veteran Member
Veteran Member
Posts:1765
Avatar

--
27 Nov 2012 07:46 PM
The server needs your client IP address so it knows where to communicate. You type this into your debug config (my #2 above). Get that with the ipconfig at a DOS prompt. That IP address is passed in the request URL. Your value is 127.0.0.1 which is useless to the server. 

Chris Ringer
Alex Krashevsky
New Member
New Member
Posts:27

--
27 Nov 2012 07:54 PM

No, I have it as xxx.xxx.xxx.xxx,127.0.0.1.

It is from ipconfig

 

Ringer
Veteran Member
Veteran Member
Posts:1765
Avatar

--
28 Nov 2012 09:03 AM

Ok. Your posted URL says debug_host=<...>%2C127.0.0.1 so i couldn't see the full value.

Did you restart the Zend server subsystem? Are PTF's current?

Chris Ringer
Alex Krashevsky
New Member
New Member
Posts:27

--
28 Nov 2012 08:26 PM
Did restart the ZENDSVR subsystem - to no avail. Not sure about the PTF's, will need to check with the owners of the IBM i server.

Also found this.

http://forums.zend.com/viewtopic.ph...=77&t=7466

The last post I believe from Zend Support person suggests the setting of the php.ini directive "sockets.use_system_read=on". I tried that, it took care of the error recorded in /www/zendsvr/logs/error_log "[3447] A remote host did not respond within the timeout period". However, the browser in remote debug session still doesn't get started, and the error in /usr/local/zendsvr/var/log/php.log "PHP Fatal error: Maximum execution time of 60 seconds..." still persists.
Ringer
Veteran Member
Veteran Member
Posts:1765
Avatar

--
28 Nov 2012 08:34 PM
"Will try and play with set_time_limit() tonight... "

And..?

Chris Ringer
Alex Krashevsky
New Member
New Member
Posts:27

--
28 Nov 2012 09:12 PM
Put together a simple script starting with set_time_limit(0). Run/Debug As/PHP Web Application results again in hung browser and messages in both logs now appearing about every 60 seconds in their respective log files.

"[3447] A remote host did not respond within the timeout period".

and

"PHP Fatal error: Maximum execution time of 60 seconds exceeded in Unknown on line 0"

(perhaps, I was too quick stating in my previous post that the former one did disappear)

Alex Krashevsky
New Member
New Member
Posts:27

--
29 Nov 2012 05:12 AM
Regarding PTFs, it was just confirmed that yes, the partition is current.
Ringer
Veteran Member
Veteran Member
Posts:1765
Avatar

--
29 Nov 2012 08:15 AM
I have not tried this but in /usr/local/zendsvr/etc/conf.d/debugger.ini temporarily try a value of 1:

; Define which clients know that the Zend Debugger is installed:
; 0 - Never. The presence of the Zend Debugger is not detected by other clients
; 1 - Always. All clients can detect the Zend Debugger
; 2 - Allowed Hosts. Only clients listed in zend_debugger.allow_hosts can detect the Zend Debugger
; Any other value makes the Zend Debugger undetectable (same as "Never")
zend_debugger.expose_remotely=2

Else contact Zend. Good luck. Let us know the solution you find.

Chris Ringer
rgtaylorii
New Member
New Member
Posts:5

--
29 Nov 2012 02:58 PM

The easiest way I found to debug is by using the studio toolbar.  You can download it as a plugin from

http://www.zend.com/en/products/stu...oads  pick the one for your browser...firefox or IE.

Once installed, make sure studio is up and running and enter the url to your php script in the browser and press enter.  Once the url has been "executed", click on the debug button in the tool bar.  This should connect to zend studio and either launch the debug perspective or ask you a question if you want it to start...Once you do this and the debug perspective starts, you can start debugging.

Alex Krashevsky
New Member
New Member
Posts:27

--
29 Nov 2012 08:01 PM
@Chris Ringer - Changed the zend_debugger.expose_remotely directive to 1 - Always. Unluckily, no change in the outcome.

@rgtaylorii - I had tried the toolbar. Re-enabled it after your post just to make sure. Firefox freezes up on me when I click Debug, and same error messages are seen in the logs then.

As for Zend, I have been in contact with them. Let's see if I can get them to arrange a Webex session for me. I haven't given up yet, there must be some sort of resolution to this.

Guys, thanks for all your help, let me know if anything else comes to your mind based on your experience.

Alex
rgtaylorii
New Member
New Member
Posts:5

--
30 Nov 2012 06:51 AM
When you debug from the tool bar plugin, firefox has to wait until you execute the script in the debug perspective in zend studio.  If you don't get through the script in a certain amount of time, firefox will stop with some type of time out error.  After you press the debug button in the tool bar, switch to zend studio and see if it has already switched to the debug perspective or asking you if you want it to start.  You have to tell the script to start executing in studio once the debug perspective is started.  Sorry if I am telling you things you have already tried...
Ringer
Veteran Member
Veteran Member
Posts:1765
Avatar

--
30 Nov 2012 07:57 AM
Thanks for info. I tried the firefox plug-in. I typed in the IFS URL, the Zend Debugger started up and put my local workspace C: drive php script in debug, not the IFS php script. These are slightly different scripts, I have not save my changes yet to the IFS.

Chris Ringer
You are not authorized to post a reply.
Page 1 of 212 > >>


Acceptable Use Policy