Phpstorm+xdebug to debug graphics and text tutorials _php Tips

Source: Internet
Author: User
Tags learn php php server php debug phpinfo vc9

The author's development environment is as follows: Windows8.1+apache+phpstorm+xdebug+firefox (XDebug helper 1.4.3 plugin).

First, Xdebug installation configuration

(1) Download Xdebug download address: http://www.xdebug.org/must download the matching version of PHP installed on the machine. The specific download method is as follows: Copy the source code of the Phpinfo Web page to http://www.xdebug.org/find-binary.php, then follow the instructions to install it. As shown in the following illustration:

(2) Install xdebug to download "Php_xdebug-2.3.2-5.4-vc9.dll" in accordance with the above figure and copy it to the d:\php\ext\ directory.

(3) Configure Xdebug to open D:\php\php.ini and add the following code at the end:

[Xdebug]
Zend_extension = D:\php\ext\php_xdebug-2.3.2-5.4-vc9.dll
Xdebug.remote_enable =1
Xdebug.remote_handler = "DBGP"
Xdebug.remote_host = "localhost"
Xdebug.remote_mode = "req"
Xdebug.remote_port = 9000

Restart Apache.

(4) Verify the installation is successful detection Method 1: In the Phpinfo Web page, can retrieve the word xdebug, the installation was successful, as shown in the following figure:

Detection Method 2:

Under cmd input php-m, can see the xdebug description configuration success. As shown in the following illustration:

The Xdebug configuration in Phpstorm is in Languages of "File"-> "Settings"-> "Frameworks &->" setting "PHP":

(1) Configure PHP server to find "Servers", configuration items are as follows: Name:localhosthost:localhostport:80debugger:xdebug as shown in the following figure:

(2) Configure PHP debug to find "Debug", the Debug port in Xdebug Fill 9000, other defaults. As shown in the following illustration:

Configuration of Xdebog Helper plug-in in Fireforx

(1) Install the Xdebug helper plugin as shown in the following illustration:

(2) Configure the Xdebug helper plugin in the image above, click "Options" and configure it as follows: IDE key:phpstormdomain filter:

LocalHost as shown in the following figure:

Four, the use of Xdebug debugging methods and procedures

(1) Turn on Debug Monitor in Phpstorm Click on the icon that looks like a phone to turn on debug monitor, as shown in the following image:

(2) Open the Xdebug helper plugin in the Chrome browser

method One: in the Address bar, click on the Bug, select Debug, as shown in the following image:

method Two: use shortcut key: Ctrl+shift+x to configure.

(3) Set breakpoints in Phpstorm by clicking in a blank space after the line number.

(4) The method of breakpoint debugging and then booting to the appropriate breakpoint in the browser can be automatically broken, as shown in the following figure:

The red box has all of the breakpoint processing and shortcut key hints.

The above is the entire content of this article, I hope that you learn PHP debugging tutorials Help.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.