Debugging (ZStudio7/Server CE) / Path Mapping

General discussion on Zend Studio

Moderator: natalia_b_zend

Debugging (ZStudio7/Server CE) / Path Mapping

Postby -theowl- on Wed Oct 27, 2010 10:06 pm

Hello,

I am currently running Zend Server CE / Zend Studio 7 / Windows 7 64 Professional.

I have a working project I want to debug. I am running my project from a virtual host I created like (http://dev.myproject.com).

In the Debug configuration I have set the PHP Server to http://dev.myproject.com, In my virtual host directory (which is located in my home directory NOT the zend server install directory) I placed the Dummy.php file and verified by clicking on Test Debugger.

When I launch the Debug session I get a Path Mapping Dialog for 50+ Zend Framework Library files. Now my Zend Framework Library files exist at C:\Program Files (x86)\Zend\ZendServer\share\ZendFramework\library\Zend and are configured in my projects PHP Include Path. Oddly enough, I am not able to select a local file via the include path, instead for every single file it asks about I have to click the radio button at the bottom of the path mapping dialog to use the file on the server.

The entire process has to be repeated every time I run debug, and takes about ten minutes to start a single debug session, repeatedly selecting use the file on the server.

If I click the Debug Configuration -> Advanced -> Source Location -> The Server. Then no breakpoints will work at all.

If I go through the path mapping routine my breakpoints work, but I cannot set a breakpoint in any of the PHP Include Path files (library/Zend).

What am I doing wrong? Thanks in advance.
-theowl-
 
Posts: 5
Joined: Wed Oct 27, 2010 9:53 pm

Re: Debugging (ZStudio7/Server CE) / Path Mapping

Postby -theowl- on Wed Oct 27, 2010 10:49 pm

This seems to be the same problem and he did a bit better job of explaining it than I did.

viewtopic.php?f=8&t=3281

No resolution in that post either.
-theowl-
 
Posts: 5
Joined: Wed Oct 27, 2010 9:53 pm

Re: Debugging (ZStudio7/Server CE) / Path Mapping

Postby -theowl- on Wed Oct 27, 2010 11:49 pm

So I figured this out.

1) Make sure the PHP_Include_Path in Zend Studio points to the Zend Framework Library in your Zend Server Installation and not the bundled version of the library that comes with Zend Studio.
2) Create a path mapping with identical server and local paths... ie C:\Program Files (x86)\Zend\ZendServer\share\ZendFramework\library (server =C:\Program Files (x86)\Zend\ZendServer\share\ZendFramework\library & Local = C:\Program Files (x86)\Zend\ZendServer\share\ZendFramework\library)
-theowl-
 
Posts: 5
Joined: Wed Oct 27, 2010 9:53 pm

Re: Debugging (ZStudio7/Server CE) / Path Mapping

Postby doogle on Fri Dec 09, 2011 8:48 am

This was helpful. The solution here is not intuitive at all.

I think this may fall under the category of a 'usability bug'.

Under the screen "Edit Path Map" with a short sentence that says "Edit server path map" you have to key in the same path twice.

"Path on server" was C:\Program Files\Zend\ZendServer\share\ZendFramework\library
"Path in file system" was C:\Program Files\Zend\ZendServer\share\ZendFramework\library

See screen shot

Image

I honestly had no idea that "Path on server" and "Path in file system" had nothing to do with the root on my server. Why doesn't this dialog say something like, "'Path to shared Zend Framework library on Zend Community Server"? Moreoever, why do people need to key in the same path twice. Also quirky is that the second line in this screenshot gets added by Zend Studio each time the debugger gets run. See below screenshot.

Image

Lastly here is something else that is a gotcha. Within the main dialog titled "Debug Configuration" there is an "Advanced" tab. This tab has a radio option called "The server". If you click it you may find that you'll be able to debug the first index.php page but not other pages. This also happens when "Debug all pages" has been selected. Moreoever, once you've selected the radio option "The server" there is no going back! You cannot unselect this radio button. You need to delete the whole configuration and start fresh.

Image

I think this whole workflow needs to be reevaluated. Zend needs to communicate better to people debugging Zend Framework Projects / Applications with their Zend Community Server. They also need to mention the role of httpd-vhosts because everyone knows if you don't have your Zend Framework Project operating from the web root you'll soon run into problems. Most Zend Framework developers have lots of projects and theirfore I think have lots of vhosts and entries in there host file. Does Zend Studio introduce an exception to this? It seems like PHP projects within Zend Studio are intended to live outside of a web server and once "Debug" gets pressed their magically get server qualities, like http://<myserver>/something. The problem here is that a Zend Framework module (application) called "something" now appears to be running outside the root (one directory in), which to my belief would cause all kinds of problems. Based on observation, I'd think if your ZF web application is not hosted from the root it's unlikely to debug correctly.

I'd love to know Zend's thoughts on this...

-Doug
doogle
 
Posts: 15
Joined: Sun Dec 06, 2009 6:01 pm

Re: Debugging (ZStudio7/Server CE) / Path Mapping

Postby doogle on Wed Nov 07, 2012 6:53 am

The above still holds true. I hit the problem again and to resolve it I had to edit my path mappings in Zend Studio. Since I test on the Community Edition of Zend Server, I simply point to the Zend Framework library there. Hope this helps people.

Cheers,
Doug C.
doogle
 
Posts: 15
Joined: Sun Dec 06, 2009 6:01 pm


Return to Zend Studio

Who is online

Users browsing this forum: No registered users and 2 guests