PHP Debug on mac____php

Source: Internet
Author: User
Beginner PHP (5.6), has been suffering from the inability to debug operation, through the print log way to view the debug information, the total feeling is not very direct and convenient.
today through the ferry and the skeleton to find a more perfect solution, first recorded here, follow-up if there is a better way to update.

1. Install Xdebug
To see if Xdebug has been installed on the terminal, perform the action: Brew Search Xdebug

To see if the corresponding version of Xdebug has been installed, and if not, perform the installation operation
Brew Install Homebrew/php/php56-xdebug

2. Configure Xdebug

Start the service using the PHP built-in server: Php-s 0.0.0.0:8080
View Phpinfo (), Additional. ini files parsed configuration entry contains/usr/local/etc/php/5.6/conf.d/ext-xdebug.ini, open the file, add
Xdebug.remote_enable=1
Xdebug.remote_autostart=1
Xdebug.remote_host=localhost
xdebug.remote_port=9000

3. Configure Phpstorm
Preferences ...

Debug Port set to 9000

Operation completed, based on built-in HTTP server to open the startup project with Phpstorm, execute the phpstorm menu Run->start listening for PHP debug connections. Request the corresponding file, you can set breakpoints in Phpstorm, the corresponding debug operation.

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.