PHP implementation of breakpoint debugging conditions
1. PHP installation xdebug extension required
2. Modify the PHP configuration file, turn on the xdebug extension, and configure the Xdebug
3. Restart the server, such as Apach or Nginx
4. Compiler configuration, I am using Vscode
Environment:
MacOS
PHP Version 7.1.16
Apach
Code Debug Editor Vscode
First you can download xdebug.so to your PHP extension folder on the website,
The PHP extension folder location can be found through phpinfo (),
Then I modified the php.ini file, and my php.ini file was stored in/etc/php.ini
The changes in php.ini are as follows:
zend_extension= "usr/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so"xdebug. remote_enable = 1 // allow remote debugging Xdebug.remote_autostart = 1= // php Maximum execution time, if it is debugging, it is recommended to change the larger point
After the modification is completed, the Apach server needs to be restarted for the changes to take effect.
Sudo/usr/sbin/apachectl restart
Then open phpinfo () to see if Xdebug successfully installed, such as indicating that the xdebug extension is installed and enabled successfully, the IDE Key must have a value.
Next open Vscode, install the PHP xdebug plugin and enable the plugin
Then in the browser open the PHP file you want to debug to hit the breakpoint, there is a problem can be commented on the below Oh!
PHP mac Xdebug configuration