Arranged in Ubuntu 14.04 under PhpStorm xdebug debugging environment in the process of reference to some articles in English have .. but can not completely solve the problem. After some agonizing finally debugging, now recorded as follows, in the hope that those who help.
1. Install xdebug
The first step: Get the local PHP configuration information
Run in a terminal: php -i> outputphp.txt
Txt file and then get the information in the copy and copy to a textarea http://xdebug.org/wizard.php This page provided. Then click on the Analyze button below it will automatically help you resolve your local PHP environment to obtain information you need to download xdebug version and configuration instructions.
For the next step, you also need to install php5-dev dependencies:
sudo apt-get install php5-dev
Step two: get to download software and related instruction
For example, I get the following information:
Download xdebug-2.3.2.tgz (just click Download link generated)
Unzip the file: tar -xvzf xdebug-2.3.2.tgz
Run: cd xdebug-2.3.2
Run: phpize (See the FAQ if you do not have phpize.
Part of the output is as follows:
Zend Module Api No: 20121212
Zend Extension Api No: 220121212
If none of the above output, represent your phpize problem. Reference FAQ.
Run: sudo cp modules / xdebug.so / usr / lib / php5 / 20121212
Some of the above steps may need to sudo.
Step 3: Adding to the php.ini configuration items
sudo vim /etc/php5/cli/php.ini
zend_extension = /usr/lib/php5/20121212/xdebug.so
xdebug.remote_host = 127.0.0.1
xdebug.remote_enable = 1
xdebug.remote_port = 9000
xdebug.remote_handler = dbgp
xdebug.remote_mode = req
If not necessary, you do not need to modify the above configuration items. Before I was taken for granted that an amendment will remote_port became my application on Server port number, making it impossible to debug. It took some time to locate the problem here is .
Here, xdebug on the successful installation can be verified by php -version command:
PHP 5.5.9-1ubuntu4.7 (cli) (built: Mar 16 2015 20:47:39) Copyright
(C) 1997-2014 The PHP Group Zend Engine v2.5.0, Copyright (c)
1998-2014 Zend Technologies
with Xdebug v2.3.2, Copyright (c) 2002-2015, by Derick Rethans
with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
Output can be found already exists Xdebug information.
2. Install the Xdebug extension helper
In the mainstream browsers have extended xdebug assistant plugin that helps you to easily open or close the debug function, why you need this plugin, you can refer to this article. 4, 5, 6 sections (English, interested Now students can voluntarily)
In Chrome, for example, where to find the installation of the plug-address:
If not open, you can refer to this article that describes how to use the widget ID for offline download, after all, Google's service is comprehensive wall ... ..
Xdebug helper plug-in ID is: eadndfjplgieldjbigjakmdgkmoaaaoc
After installation is complete, open the options of the widget set IDEKey to PhpStorm.
3. Configure PhpStorm
And finally to the last step, this step is very simple.
Is checked Start Listening for Run menu PHP Debug Connections.
Then hit the place you need to debug breakpoint, enter the address of the last PHP script in the browser on it. Note To enable Xdebug Helper before installation.