I have referenced some articles in the xdebug debugging environment configuration in PhpStorm under Ubuntu14.04, both in Chinese and English .. however, this problem cannot be completely solved. after some twists and turns, we can finally debug it. Now we have recorded the following records, hoping to help later users. 1. step 1 of xdebug installation: Obtain the local PHP configuration information and run php-i>outputphp.txt on the terminal. Then copy the information in the obtained txt file and copy it to htt.
I have referenced some articles in the xdebug debugging environment configuration in PhpStorm of Ubuntu 14.04, both in Chinese and English .. however, this problem cannot be completely solved. after some twists and turns, we can finally debug it. Now we have recorded the following records, hoping to help later users.
1. Install xdebug
Step 1: Get the local PHP configuration information
Run: php-I> outputphp.txt on the terminal
Then copy the information in the resulting txt file and copy it to a textarea provided on the http://xdebug.org/wizard.php page. click the Analyze button below to automatically parse your local PHP environment information and obtain the xdebug version and related configuration commands you need to download.
To perform the following steps, you also need to install the php5-dev dependency package:
sudo apt-get install php5-dev
Step 2: Get the version and related commands to be downloaded
For example, the following information is obtained:
- Download xdebug-2.3.2.tgz (click the generated link directly)
- Decompress the file:
tar -xvzf xdebug-2.3.2.tgz
- Run:
cd xdebug-2.3.2
Run:phpize (
See the FAQ if you don't have phpize.
Some outputs are as follows:
Processing ing:
...
Zend Module Api No: 20121212
Zend Extension Api No: 220121212
If the above output is not available, it indicates that your phpize has a problem. Refer to the FAQ.
Run:./configure
- Run:
make
- Run:
sudo cp modules/xdebug.so /usr/lib/php5/20121212
The above steps may require sudo.
Step 3: Add configuration items to php. ini
sudo vim /etc/php5/cli/php.inizend_extension = /usr/lib/php5/20121212/xdebug.soxdebug.remote_host = 127.0.0.1xdebug.remote_enable = 1xdebug.remote_port = 9000xdebug.remote_handler = dbgpxdebug.remote_mode = req
If not necessary, the preceding configuration items do not need to be modified. previously, I changed the remote_port item to the port number of my application on the Server, leading to the failure of debugging. it took some time to locate the problem.
Here, xdebug is successfully installed. You can verify the installation by running the 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
Xdebug information already exists in the output.
2. Install Xdebug extension helper
Xdebug extension assistant plug-ins are available in mainstream browsers to help you easily enable or disable debugging functions. For more information about the plug-ins, see Section 4, 5 in this article, section 6 (in English. If you are interested, you can check it yourself)
Taking Chrome as an example, find the plug-in installation address here:
Https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc? Hl = en
If the plug-in cannot be opened, you can refer to this article to introduce how to use the plug-in ID for offline download. After all, Google's services are fully protected by the wall .....
The plug-in ID of Xdebug helper is eadndfjplgieldjbigjakmdgkmoaaaoc.
After installation, open the options of the plug-in and set IDEKey to PhpStorm.
3. Configure PhpStorm
Finally, this step is very simple.
SelectRunUnder the menuStart Listening for PHP Debug Connections.
Then, place a breakpoint where you need to debug it, and enter the PHP script address in the browser. Note that you need to enable the previously installed Xdebug Helper.
You can enable the following methods:
OK. Have fun debugging !!!
Principle (referenced on the xdebug official website)
PhpStorm support for AngularJS http://www.linuxidc.com/Linux/2014-05/102485.htm
PhpStorm details: Click here
PhpStorm: Click here
This article permanently updates the link address: Http://www.linuxidc.com/Linux/2015-08/122444.htm