Debug PHP command line script in PHPStorm -


I use debugging as my primary device for PHP and am very happy. So far I'm using Firefox to run the script, and the PHPStor breaks completely.

Now I have a situation where I am running a PHP script through the command line (not the browser) and want to know that there is a way to setup PHPStorm to break when the command line Running a PHP script from?

It is possible to debug with the Php Remote Debug configuration. Note that there is an error in this tutorial, you need to set QUERY_STRING like this on Windows ():

  SET "QUERY_STRING = start_debug = 1 & debug_port = 10137 and debug_host = 127.0.0.1 and debugapp = 1 & amp; no_remote = 1 & amp; debug_session_id = 10000 "  

(which is important to note the difference in quoted).

Set up PhpStorm as shown on the screenshot:

fake server

remote debug

debug on the main toolbar button.

  D: \ dev \ zend \ ZendServer \ bin \ php.exe d: phpStorm will start listening for the debugger connection.  

Run your script in the command line: \ Work \ attaches \ sample \ help.php

PhpStorm will affect breakpoints:

breakpoint hit

It was tested on Windows with Zend server installation, but other systems and Should be similar with xdebug.

If you want to debug directly from PhpStorm, use the Php script / debug configuration type. To configure for this project, your PHP instance configuration files should have Zend Debugger or Xdebug enabled.

The PHP home and debugger mode can be specified in the file | Settings | PHP .

Just work with me for Zend server installation (PHP home: D: \ dev \ zend \ ZendServer \ bin \ / code>) and Zend debugger has been verified

Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -