Foreword: The previous article has introduced the overload Windows PHP debug (phpstorm+xdebug Breakpoint Debugging PHP), the MAC configuration process is exactly the same, but encountered a variety of twists and turns are tired, and encountered the pit is summarized as follows (in fact, February wrote has not been issued) , and now share it with you. Step flow one. Download and install the corresponding Xdebug two for your PHP version. Make a consistent change to the configuration file, including php.ini and Phpstorm configuration, Chrome xdebug configuration three. Break points in the program and click "Bugs" for Debug.
I. Download the Xdebug file
1. The information of Phpinfo () will be entered into the box in the URL, and the appropriate Xdebug version can be obtained:URL: http://xdebug.org/wizard.php
2. Download and extract(oneself know version of, do not go to the previous step directly to download, URL: http://www.xdebug.org/download.php) wget [download Address]////If wget cannot be used, run: [Brew install wget];
sudo tar-zxvf xdebug-2.5.0.tgz
cd xdebug xdebug-2.5.0
3. Compile complete get xdebug.so
Phpize
./configure--enable-xdebug--with-php-config=/usr/bin/php-config (path to the correct configuration of php-config) make
4. To
/xdebug-2.5.0/modules/
xdebug.so files are moved into PHP extensions
sudo find/-name xdebug.so //Locate the original xdebug.so file store address
Get the address of the. So configuration file/usr/lib/php/extensions/no-debug-non-zts-20131226
5. Copy past
cp/xdebug-2.5.0/modules/xdebug.so/usr/lib/php/extensions/no-debug-non-zts-20131226
6. Restart Apache
sudo apachectl restart
Small Episode:The fifth step above the copy move, failed
Tip: CP:/usr/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so:operation not permitted originally was OS X 10.11 El Capitan (or higher) a new security mechanism has been added to protect system Integrity Protection (SIP), so the directory/system/sbin/usr (not including (/usr/local/) cannot be modified We have to turn it off. Step: A. reboot computer B. Hold COMMAND + R (start clicking after the screen is turned on, Apple logo, OK) c. Menu "Utility" ==>> "terminal" ==>> input csrutil disable; Out: Successfully disabled System Integrity Protection. Please restart the "machine for" changes to take effect. D. Reboot the system again
After restarting, repeat the steps above, and then once again cp/xdebug-2.5.0/modules/xdebug.so/usr/lib/php/extensions/no-debug-non-zts-20131226
Successfully moved.
Two. The configuration process of related documents
1. Configure PHP.ini
sudo vi/private/etc/php.ini
[Xdebug]
zend_extension= "/usr/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so"
xdebug.remote_enable =
on Xdebug.remote_handler = dbgp
xdebug.remote_host= localhost xdebug.remote_port = 9000 Xdebug.idekey
= Phpstorm
sudo apachectl resrart//Restart Apache
View phpinfo () search xdebug see the corresponding version of your download, indicating that the installation was successful. View Phpinfo (); Show installation and Success
2. Configure PhpstormEnter File>settings>php>debug, see Xdebug tab, Port Fill 9000, other default into FILE>SETTINGS>PHP>DEBUG>DBGP Proxy, IDE Key Fill Phpstorm,host fill localhost,port 80 Reference-phpstorm+xdebug breakpoint debugging php:http://blog.csdn.net/ty_hf/article/details/ 50768702
3. Configure the chrome XdebugA. Install the chrome debug download address: http://download.csdn.net/detail/ty_hf/9762139 download and drag into the browser. (or jailbreak to the Chrome store to download, search xdebug, download, install) Https://chrome.google.com/webstore/search/xdebug?hl=zh-CN
B. Run
Three. Breakpoint Test no longer repeat here, details can refer to the debugging process under Windows: Phpstorm+xdebug Breakpoint Debugging php:http://blog.csdn.net/ty_hf/article/details/50768702 1.
2.
3.
Four. Encounter the Pit Story episode, Bo main debugging process encountered in the pit: Problem 1: All the installation is correct, but is not xdebug, why. Originally debugging Windows under the Xdebug, in fact, the process is a hair the same, but in the php.ini set that step is not the same, to point to the DLL into the. So file, change the operating system, we all understand, but it is dead or alive. Cause: The xdebug.so version is incorrect, the Mac comes with xdebug.so version 2.3 (phpinfo), please install the detected version mentioned above Xdebug.so, mine is 2. 5 version of the issue 2: Google browser Xdebug plug-in can not start, is gray. Alt+shift+x start it, but not bright, and then tested, because I used 9100 port, don't think too much, obediently first use 9000 is good 3.: Compile the new version of Xdebug after the move xdebug.so failure hint: Operation not permitted Reason: Mac OS's self-protection mechanism, turn SIP protection off. Five. Related article: Phpstorm+xdebug breakpoint debug php:http://blog.csdn.net/ty_hf/article/details/50768702 Mac OS How to turn off SIP protection: http:// blog.csdn.net/qq285744011/article/details/52810066 Breakpoint Debug Environment Configuration http://www.tuicool.com/articles/aiE322z This article address: http:// blog.csdn.net/ty_hf/article/details/72081965