Phpstorm xdebug Installation Configuration Instructions _php Tutorial

Source: Internet
Author: User
Tags php debug phpinfo what php zts
This article to introduce Phpstorm xdebug installation configuration instructions, this is not the first time I configured Phpstorm, the following experience to share to you.

With Xdebug is not the first time, but with Phpstorm Xdebug is the first time (admit that the ability to correct the error is very strong, coupled with the framework of the familiar degree is very fast, know the problem file location directly repair code, there is no need to use Xdebug+ide debugging to find the problem). Since April to participate in the new work has not time to toss the IDE level of things, today finally a little free time to play the next ~

Since the installation and configuration of Xdebug is a commonplace topic, the way and process of installing xdebug is no longer described, and the configuration requirements for Xdebug sections are explained only for php.ini phpstorm requirements.


PHP.ini Configuration
"[Xdebug]
zend_extension= "/usr/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so"
xdebug.idekey= "Phpstorm"
xdebug.remote_host=127.0.0.1
Xdebug.remote_enable=on
Xdebug.remote_port = 9000
Xdebug.remote_handler = "DBGP"
Xdebug.auto_trace = 1
Xdebug.collect_includes = 1
Xdebug.collect_params = 1
Xdebug.collect_return = 1
xdebug.default_enable = 1
Xdebug.collect_assignments = 1
Xdebug.collect_vars = 1
Xdebug.remote_autostart = 1
Xdebug.remote_connect_back = 1
Xdebug.show_local_vars = 1
Xdebug.show_exception_trace = 0

"about how xdebug.so is configured, the Xdebug documentation describes:

"Configure PHP to use Xdebug

Add the following line to Php.ini:zend_extension= '/wherever/you/put/it/xdebug.so ' (for non-threaded use of PHP, for Examp Le the CLI, CGI or Apache 1.3 module) or:zend_extension_ts= "/wherever/you/put/it/xdebug.so" (for threaded usage of PHP, F or example the Apache 2 work MPM or the the The ISAPI module). Note:in case you compiled PHP yourself and used–enable-debug you would has to use zend_extension_debug=. From PHP 5.3 onwards, all need to use the Zend_extension php.ini setting name, and not zend_extension_ts, nor zend_ Extension_debug. However, your compile options (zts/normal build; debug/non-debug) still need to match with what PHP is using.

Restart your webserver.
Write a PHP page that calls ' Phpinfo () ' Load it in a browser and look for the info on the Xdebug module. If you see it next to the Zend logos, you have been successful! You can also use the ' php-m ' if you had a command line version of PHP, it lists all loaded modules. Xdebug should appear twice there (once under ' PHP Modules ' and once under ' Zend Modules ').

"Where is the use of zend_extension_ts or zend_extension or god horse God horse, with the PHP version, carefully read the above instructions."

Restart the Web Server (Apache/nginx), using the Phpinfo () page or the command line tool to confirm that the module installation is complete.

Phpstorm Configuration


I'm using phpstorm5.0.4, even though the lower version doesn't matter, the configuration described in this tutorial is generic in the 4.0~5.+ version.

1.file>settings,php | Server: Click on the + symbol, Name column enter the name you give the server, the Host column enter the address of the debug server, without "http:/". Enter the server's product (usually the default value) in the Port column and select Xebug in the Debugger column.

Debugger one column select Xebug.

2.file>settings,php | Debug, in the Xdebug tab box, configure debug Port according to the server-side Xdebug port, and configure additional parameters as needed.

3. Click Use debugger bookmarklets to initiate debugging from your favorite browser, configure debugger bookmarks in the system's default browser.

4. The default browser is opened and entered http://www.jetbrains.com/phpstorm/marklets/, modify the IDE key under the Xebug column, the default is Phpstorm.

5. Click the Generate button in the Xdebug column to add the Xdebug group to the browser's bookmarks, which have xdebugger items.

6. Back to Phpstorm, PHP in the Settings dialog box | Debug | Xdebug Proxy, add the IDE key specified in step fifth and configure the proxy host and proxy port.

In this, you can already use the "Listen" feature. Whenever you access the application on the specified debug server, first click on the start Listen PHP Debug Connection button in Phpstorm to start monitoring the debug port;

Click the Xdebug start Session in the browser bookmark, turn on the Debug function, then click Xdebug This page, the Xdebug break on, the xdebug break off, etc., can call PHP Storm, debugging the program, It is very convenient to delete breakpoints, display the values of variables and expressions in the current state.

In addition, for the framework/project debugging mode needs to be based on the above configuration, and then some configuration:

1. Click the Run–edit Configurations option in the menu.

2. In the dialog box that pops up, configure the following diagram:

3.: Click on the "Add" button, select PHP Web application, and enter the configuration name on the right, select the Server,start URL we just added to fill in the debugging may be required in the query string, select a good default browser, finally click Apply and OK, confirm the configuration.

4. Then, there is one more step:

Set breakpoints in the program;
In the toolbar, select the application you want to debug.
Click the start Listen php debug Connections button, that is, the red phone button to turn it green, that is, start listening to the PHP debug connection;
So, finally can begin.
Click on the Debug button, or choose Run–debug from the menu and you'll start the Debug tour ...

Other Notes

Depending on the breakpoint configuration, or in the process of opening the debug URL, or after POST, if the Phpstorm supervisor hears the debug connection, it will immediately switch to the editor interface and jump to the set breakpoint, and the browser will wait for phpstorm operation.

You can interrupt Phpstorm debugging at any time, or conveniently perform Step into/step Over/run to the cursor (this diao explodes):

Kids who are familiar with Java will feel friendly and roar at the interface.

Oops, do not want to debug, phpstorm but always jump out? Remember just the phone button, then click, let it turn red, just fine.

Get here first, huh? Beat the drums yourself.

http://www.bkjia.com/PHPjc/629824.html www.bkjia.com true http://www.bkjia.com/PHPjc/629824.html techarticle This article to introduce phpstorm xdebug installation configuration instructions, this is not the first time I configured Phpstorm, the following experience to share to you. With Xdebug is not the first time, but with ...

  • 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.