Debug PHP with X-debug under IntelliJ idea or phpstorm

Source: Internet
Author: User
Tags netbeans

Use IntelliJ idea or phpstorm to debug PHP using X-debug, the main need to configure the section has three places, respectively, the configuration of the php.ini, the configuration of idea and browser configuration, mainly as follows, in order to forget:

  • The main configuration of php.ini is as follows, the key parameters can be modified according to the actual situation:
    [Xdebug]
    Zend_extension_ts= "X:/app/php-5.2.17-win32-vc6-x86/ext/php_xdebug-2.1.1-5.2-vc6.dll"
    Xdebug.remote_host=jichengdiaoding.com
    Xdebug.remote_port = 9000
    Xdebug.remote_mode = "req"
    Xdebug.remote_enable = On
    Xdebug.remote_handler = DBGP
    Xdebug.idekey = "Netbeans-xdebug"
    Xdebug.profiler_enable=on
    Xdebug.trace_output_dir= "X:/app/php-5.2.17-win32-vc6-x86/xdebuginfo"
    Xdebug.profiler_output_dir= "X:/app/php-5.2.17-win32-vc6-x86/xdebuginfo"
    Xdebug.auto_trace=on
    Xdebug.collect_params=on
    Xdebug.collect_return=on
    Xdebug.show_exception_trace = On
    Xdebug.remote_autostart = On
    Xdebug.collect_vars = On is configured, in the cmd input x:/app/php-5.2.17-win32-vc6-x86/php.exe-m, if you can see the Xdebug module, indicating the success of the Open.
    *: It is worth noting that the corresponding version of Xdebug and PHP needs to be determined here.
  • IDEA is configured as follows:
    Enter File>settings>php>servers, here to fill in the server side of the relevant information, Name fill in the hostname to debug (such as: jichengdiaoding.com or localhost, etc.), host fill (such as: localhost or amiku.cn, etc.), Port fill 80,debugger Select Xdebug

    Enter File>settings>php>debug, see Xdebug tab, Port Fill 9000, other default

    Enter FILE>SETTINGS>PHP>DEBUG>DBGP proxy,ide key to fill in the Netbeans-xdebug,host fill Jichengdiaoding.com,port fill 80
  • In Firefox or Chrome browser, find the corresponding X-debug version of the plugin, the following is the Firefox debug plugin:

    The IDE key in the tool's setup fills in the Netbeans-xdebug, adds the jichengdiaoding.com to the whitelist, and then turns the tool on when debugging.

    Open PHP Listening in idea, then you can enter debug mode, convenient break points and view variables, monitoring and so on.
  • Configuration is complete.

Debug PHP with X-debug under IntelliJ idea or phpstorm

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.