2

I am running Zend Server 5.6.0 which is PHP 5.4 and I am using PhpStorm 5.0. I am looking to put some profiling and debugging in place.

I have configured everything that I can see in PhpStorm, when I run the debug from the IDE it runs the script, then displays Connection with 'Zend Debugger' was not established. Validate Installation.

I have installed the toolbar but whenever I try to debug a page in Firefox it actually pops up with a download window and the file downloads, when opened it displays a server error.

All of the help guides online dont seem to work, has anyone else has these issues?

Jucks
  • 400
  • 4
  • 10
  • Is the Zend debugger itself configured? If you are running Zend Server on your local machine it should just work but if it is installed elsewhere on your network you may need to add your IP address as an allowed IP. – Wige Dec 05 '12 at 15:52
  • It is configured in that if I do phpinfo() its all listed as it should be. Also I am assuming something is happening as when I try and do the debug via the bookmarklet it suddenly stops the parsing of the .php file and initiates a download (essentially just html markup displaying an error) - whats strange though is even though it shows a server error in the file it shows "200 OK" in the title attribute, I would have thought it would have been a 500. Not sure if that helps. – Jucks Dec 05 '12 at 17:52
  • What run configuration do you use for debugging? – Nikolay Matveev Dec 05 '12 at 18:37
  • Note sure exactly, where would I find that information? It seems that its actually crashing php.exe whenever it runs. I am currently in the process of getting xDebug setup, hopefully I will have more luck with that. – Jucks Dec 05 '12 at 19:12

2 Answers2

3

I ended up using Xdebug:

To Install Xdebug:

  1. Go to webpage.
  2. Paste your phpinfo() contents into the box
  3. Follow the instructions on the wizard page except for where it tells you to add zend_extension = C:\Zend\ZendServer\lib\phpext\php_xdebug-2.2.1-5.4-vc9-nts.dll to the top!, put this below the iOnCube Loader (if you have it installed)
  4. Add the following to php.ini then restart PHP & Apache.

php.ini

[XDebug] 
xdebug.remote_enable=1 
xdebug.remote_port=9000 
xdebug.profiler_enable=0 
xdebug.profiler_output_dir="C:\Zend\ZendServer\tmp\xdebug-profiler"  

Xdebug in PhpStorm

  1. Generate and add bookmarklets to your browser here (Note the IDE key ##PHPSTORM##)
  2. Open File -> Settings -> PHP
  3. Choose your interpreter
  4. Click [..]and choose Debugger: Xdebug
  5. Click the "Configurations" then Edit Configurations... item (Drop down next to debug button on toolbar)
  6. Press the [+] to add a configuration and choose PHP Remote Debug
  7. Call it Xdebug and use the IDE key PHPSTORM
  8. You can now start the debugger (Alt+Shift+F9)
  9. Start the debugger using the bookmarklet

You can now stop through code in PhpStorm, hope this helps someone

jezrael
  • 822,522
  • 95
  • 1,334
  • 1,252
Jucks
  • 400
  • 4
  • 10
0

This is happening because PHPStorm is using the binary for php found under /usr/bin this is not the same one as Zend Server uses under /usr/local/zend/bin. On some systems like Mac PHP is already installed by default under /usr/bin but it will not interact with the Zend Server/Debugger.

To fix this all you have to do is go into the PHPStorm preferences and tell it to use the proper Interpreter. Click the ... button next to the Interpreter drop down and give it the path to zend's bin directory /usr/local/zend/bin

This solved the issue with PHPStorm debugging with the Zend Debugger.

Joseph Crawford
  • 1,470
  • 1
  • 15
  • 29