1. Build PHP Local running environment specific click How to use phpstudy local build multi-site (each site corresponds to a different port)
2. Download php_xdebug.dll,
"PHP version 5.3 or above"Http://pecl.php.net/package/xdebug
"PHP version 5.3 and below"http://pecl.php.net/package/xdebug/2.2.7/windows
Note that the version should correspond, or it may not work.
3. Install the PHP xdebug extension (i.e. add the following code in the configuration php.ini file)
[XDebug] = "D:\phpStudy\php53n\ext\xdebug\php_xdebug.dll" xdebug. remote_enable = on xdebug . Remote_handler = "DBGP" xdebug. Remote_host = "127.0.0.1" xdebug. Remote_port = 9000
D:\phpStudy\php53n\ext\xdebug\php_xdebug.dll This path is for reference only, depending on the path you have stored locally.
Create a new PHP file in your local test environment, type
<?php
Phpinfo ();
?>
Then view the page in the browser,
If the result is similar to the red box code that the PHP xdebug extension installation is successful, or you can check the next step of the problem.
4. Install xdebug helper 1.4.2 Extension for Google Chrome (go to Baidu Search to download and install it), after installation is completed as follows:
Install browser plugin Debug PHP
Install the chrome plugin. Xdebug Helper Configuration Xdebug Helper. Open the Chrome extensions option.
Configuration:
Save, restart the chrome
5. In the sublime text shortcut key ctrl+shift+p The package control input install enter confirm. :
6.sublime open a. php file. Select a row by pressing Ctrl + F8 to set a breakpoint, and the shortcut key to delete the breakpoint is also Ctrl + F8
Open the chrome input localhost/php101/test.php My example address:
Click the Xdebug plugin in the Chrome browser address bar and select the first item.
Back to sublime PHP code interface Press ctrl+shift+f9 to start debugging, back to Chrome press F5 refresh , and then to the sublime interface will see such as debug code
Press Ctrl+shif+f5 to execute to the next statement, Ctrl+shif+f6 executes to the next breakpoint.
Sublime Exit Xdebug Press Shift+alt+1
How do I debug PHP code in Sublime+chrome?