Mac under Phpstorm configuration Xdebug tool

Source: Internet
Author: User


Reference:How to use the Xdebug tool in Phpstorm, entry-level operation method

http://blog.csdn.net/knight_quan/article/details/51953269


If you use the integrated environment Xmapp,mamp, Baidu-related, such as:

Http://www.cnblogs.com/lishiyun19/p/4470086.html

Http://www.linuxidc.com/Linux/2016-06/132333.htm


And the following video is about how to install under the phpstudy2016. Refer to the first look.

Http://pan.baidu.com/s/1bpEN4ZX


This article is not an integrated environment.


Install the Xdebug extension first. Here a little. Because I was ready to use xdebug, I found that it was installed.


1. View by Phpinfo () , Configuration File (php.ini) Path

In a directory, write a phpinfo.php file,

Written inside

<?phpecho phpinfo ();


For example: demo.ccc/default/phpinfo.php

can be found.


PHP Version 5.6.29

Configuration File (php.ini) Path


/usr/local/php5/lib
Loaded Configuration File /usr/local/php5/lib/php.ini

And the Xdebug is already installed.

Xdebug Support
Xdebugenabled
Version 2.2.5

Xdebug.remote_mode


Req Req
Xdebug.remote_port 9000 9000



2. Output command to find php.ini, plus [Xdebug]

Output command:

macdemacbook-pro:/mac$ php-i |grep php.iniconfiguration File (php.ini) Path =/usr/local/etc/php/5.6loaded Configur ation File =/usr/local/etc/php/5.6/php.ini


In terminal mode open Php.infi This file, to the last line, plus a paragraph: vi to the last line with : $ Enter.

macdemacbook-pro:/mac$ sudo vi/usr/local/etc/php/5.6/php.ini

[Xdebug]; prefix =/usr/local/etc/php/5.6/; This parameter is the Xdebug.so module to be loaded, specifically ext can go to zend_extension = "/usr/local/php5-5.6.29-20170114-210819/lib/php/extensions/ No-debug-non-zts-20131226/xdebug.so "; Whether remote can be used, must xdebug.remote_enable = on; Remote host, default local, can then be configured as vagrant address Xdebug.remote_host = 127.0.0.1; If the 9000 default port fails, use a non-9000, such as 9010, it is best to change, avoid fuckxdebug.remote_port = 9000; Use DBGP to do 80 port proxy xdebug.remote_handler = DBGP; The key here must be consistent with the IDE in the time Xdebug.idekey = Phpstorm; Output log file, personally feel very important xdebug.remote_mode= "req" xdebug.max_nesting_level=600

Description

Zend_extension is the extension to xdebug.

Xdebug.idekey= "Phpstorm" is pointing to your phpstorm IDE.

This will allow your phpstorm to capture the breakpoint event.

Because I saw through the Phpinfo ()

Xdebug.remote_port, it's already 9000. There is no modification.



3. Open Phpstorm

Icon, is a class hand.

Open the Settings screen to find the PHP column and let your IDE and your PHP bind together.

my php path is /usr/local/cellar/php56/5.6.29_5/bin/php (the path varies from one point to your own PHP)

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/97/50/wKiom1ktQemA_dcXAAMe5ihqUFM002.png "title=" 11. PNG "alt=" Wkiom1ktqema_dcxaame5ihqufm002.png "style=" width:700px;height:398px; "width=" "vspace=" 0 "hspace=" 0 " height= "398" border= "0"/>


650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/97/50/wKiom1ktQjCBSMSXAAIy6e4ItSc931.png "title=" 12. PNG "alt=" Wkiom1ktqjcbsmsxaaiy6e4itsc931.png "style=" WIDTH:700PX;HEIGHT:574PX; "width=" "vspace=" 0 "hspace=" 0 " height= "574" border= "0"/>



Next we need to get phpstorm to turn on xdebug monitoring.

Find PHP = Debug

Set Debug port: To 9000 (as you wrote in php.ini above)

Because maybe your 9000 port is occupied, you can also change to 9001,9002 etc of course if you change the port

Need to write a line in the php.ini xdebug.remote_port= 9001 in order to correspond to the Xdebug listening port.


650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M02/97/52/wKioL1ktQyaSMuRVAALr09x_qsc086.png "title=" 13. PNG "alt=" Wkiol1ktqyasmurvaalr09x_qsc086.png "style=" width:700px;height:412px; "width=" "vspace=" 0 "hspace=" 0 " height= "412" border= "0"/>


650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/97/52/wKioL1ktS2fBcz91AAIUPkznV84246.png "title=" 14. PNG "alt=" Wkiol1kts2fbcz91aaiupkznv84246.png "style=" width:700px;height:432px; "width=" "vspace=" 0 "hspace=" 0 " height= "432" border= "0"/>


I recommend the easiest Xdebug plugin under Firefox,

Set IDE key = Phpstorm in Options

(which is the same as the IDE key set under DBGP Proxy), and is not complex to configure.

After installation, it is a red reptile.


OK to complete the above equipment work your xdebug has been configured.

Next let's run up this breakpoint debugging!


4. Final step: (RUN DEBUG)

Find Phpstorm Run=>start Listening for PHP debugconnections

(After opening your phpstorm will start listening to PHP)




5. Click on the Green Crawler in the phpstorm to jump to the browser.

Then you look at Phpstorm, there are xdebug. One-step debugging is possible.



Open Postman (an extension tool in Google Chrome can be used to simulate requests such as Post,get)

Attention!

Add a xdebug_session_start= phpstorm to the API parameters you requested this is to tell your request to trigger a breakpoint debug

Once send has triggered xdebug

You'll be jumped back into your phpstormide.


Ok

So you can debug the code.


= =

I also just used, took a lot of time to install, not too familiar. This has to be a bit of a grope.


----------  recruit the future great God -----------------------

If you have altruistic heart, willing to help others, willing to share
If you encounter PHP problem, Baidu and asked the other groups still did not get answers

Welcome to join, PHP technical question and answer group, QQ Group: 292626152

Educational developments Help others, you will also get promotion!

In order to cherish everyone's valuable time, please do not chat.

May we help each other and grow together!

Add message code, PHP,AJAX,THINKPHP,YII ...


Mac under Phpstorm configuration Xdebug tool

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.