Home  >  Article  >  Backend Development  >  wampserver+phpstorm+xdebug environment configuration debugging php code

wampserver+phpstorm+xdebug environment configuration debugging php code

不言
不言Original
2018-04-27 13:35:413482browse

This article mainly introduces the wampserver phpstorm xdebug environment configuration and debugging php code. It has a certain reference value. Now I share it with you. Friends in need can refer to it

wampserver phpstorm xdebug environment configuration and debugging php Code

  • wampserver installation

  • ##phpstorm installation

  • xdebug installation

  • Debugging under phpstorm


wampserver installation

Wampserver installation is relatively simple, you only need to download wampserver.exe and continue all the way

phpstorm installation

phpstorm download address: https ://www.jetbrains.com/phpstorm/

phpstorm cracking method: http://www.oyksoft.com/soft/40722.html?pc=1
After the installation is complete, if phpstorm still does not crack correctly, check to see if your host file has 0.0.0.0 account.jetbrains.com added to it. The specific host file storage location is: C:\Windows\System32\drivers\ etc

xdebug installation

By default, if you install wampserver, the xdebug plug-in is installed by default. The specific xdebug installation path can be viewed in php.ini Find it. The way to find it is to left-click the wampserver program icon, find the PHP option, find php.ini, click in, and search for [xdebug]. The value of zend_extension is your xdebug storage location. In order to be able to debug the php code in phpstorm, we You need to add the following code at the end of the [xdebug] tag in php.ini:

zend_extension ="E:/StudySoftware/wampserver/wamp/bin/php/php5.6.25/zend_ext/php_xdebug-2.4.1-5.6-vc11.dll"xdebug.remote_enable = 1xdebug.profiler_enable = off
xdebug.profiler_enable_trigger = Off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir ="E:/StudySoftware/wampserver/wamp/tmp"xdebug.show_local_vars=0xdebug.idekey=PhpStorm  
xdebug.remote_enable = On  
xdebug.remote_host=localhost  
xdebug.remote_port=9000  xdebug.remote_handler=dbgp
After the configuration is completed, restart wampserver, then enter localhost in the browser, find phpinfo, and click in , search for xdebug and find the following content:


wampserver+phpstorm+xdebug environment configuration debugging php code

Install the Xdebug plug-in under Google Chrome

Download address: http://www.downza. cn/soft/211550.html

After the download is complete, click the spider icon in the upper right corner, select options, and enter the content as shown below

wampserver+phpstorm+xdebug environment configuration debugging php code

phpstorm debugging configuration

(1): File->Settings->Languages&Frame Works->Php->Servers Configure server-related settings. The configuration content is as shown in the figure below


wampserver+phpstorm+xdebug environment configuration debugging php code (2): File->Settings->Languages&Frame Works->Php->Debug->DBGp Proxy configuration related settings, the configuration content is as shown below:

wampserver+phpstorm+xdebug environment configuration debugging php code (3): File->Settings->Languages&Frame Works->Php-Debug Find the debug settings corresponding to the window on the right, change the port to 9000, and the configuration content is as shown below:

wampserver+phpstorm+xdebug environment configuration debugging php code

phpstorm for debugging

(1): Enter: http://localhost/startwill/index.php in Google Chrome. Of course, you can change this address at will

(2): Click on the xdebug plug-in in Google Chrome and select the Debug option

wampserver+phpstorm+xdebug environment configuration debugging php code (3): Open one of our own php files in phpstorm, here mine is the index.php file, set a breakpoint, and click the debug button in the upper right corner:

wampserver+phpstorm+xdebug environment configuration debugging php code (4): After pressing the Enter key in the browser, it will execute to the breakpoint we set

Reference

  • http://developer.51cto.com/art/201704/536857.htm

The above is the detailed content of wampserver+phpstorm+xdebug environment configuration debugging php code. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn