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.