PHPStorm + XDebug for debugging graphic tutorials,

Source: Internet
Author: User

PHPStorm + XDebug for debugging graphic tutorials,

My development environment is as follows: Windows8.1 + Apache + PhpStorm + XDebug + Firefox (XDebug helper 1.4.3 plug-in ).

I. XDebug installation and configuration

(1) download XDebug: http://www.xdebug.org/ to download the PHP matching file installed on the machine. The download method is as follows: copy the source code of the phpinfo webpage to http://www.xdebug.org/find-binary.php, and install it as instructed later. As shown in:

(2) install XDebug follow the download "php_xdebug-2.3.2-5.4-vc9.dll", copy it to the d: \ php \ ext \ directory.

(3) Configure XDebug to open d: \ 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) check whether the installation is successful method 1: On the phpinfo page, you can retrieve the XDebug text, and the installation is successful, as shown in:

Method 2:

Enter php-m in cmd and you can see that XDebug indicates that the configuration is successful. As shown in:

2. Configure XDebug in PHPStorm in File> Settings> programming ages & Frameworks> Setting of PHP:

(1) configure the PHP Server and find "Servers". The configuration items are as follows: Name: localhostHost: localhostPort: 80 Debugger: XDebug, as shown in:

(2) Configure PHP Debug and find Debug. Set Debug Port in XDebug to 9000. As shown in:

Iii. XDebog helper plug-in configuration in Fireforx

(1) install the XDebug helper plug-in, as shown in:

(2) configure the XDebug helper plug-in, click [Options], and configure as follows: IDE key: PhpStormDomain filter:

Shows localhost:

Iv. XDebug debugging methods and steps

(1) Enable the Debug listener in PHPStorm and click the phone-like icon to enable the Debug listener, as shown in:

(2) Enable the XDebug helper plug-in Chrome

Method 1:In the address bar, click the bug and select Debug, as shown in:

Method 2:Use the shortcut key CTRL + SHIFT + X for configuration.

(3) In PHPStorm, set the breakpoint and click in the blank space behind the row number to set the breakpoint.

(4) the method for breakpoint debugging and then guiding to the corresponding breakpoint in the browser can be automatically disconnected, as shown in:

There are some breakpoint handling methods and shortcut keys in the red box.

The above is all the content of this article. I hope it will help you learn the PHP debugging tutorial.

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.