PHP mac Xdebug Configuration

Source: Internet
Author: User
Tags phpinfo

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

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.