download
https://pecl.php.net/get/xdebug-2.7.2.tgz
Decompression
tar -zxvf xdebug-2.7.2.tgz
Enter the directory
cd xdebug-2.7.2
phpize
/Applications/MAMP/bin/php/php7.3.1/bin/phpize
configure
./configure --with-php-config=/Applications/MAMP/bin/php/php7.3.1/bin/php-config --enable-xdebug
make && make install
Join xdebug configuration in php.ini
[Xdebug]
the zend_extension = "/ the Applications / the MAMP / bin / PHP / php7.3.1 / lib / PHP / Extensions / non-NO-Debug-ZTS-20,180,731 / xdebug.so"
xdebug.remote_enable. 1 =
xdebug.remote_autostart. 1 = Xdebug = .idekey PhpStorm xdebug.remote_host = localhost xdebug.remote_handler = dbgp; default php-fpm 9000 has been occupied, remember = 9001 for a port xdebug.remote_port xdebug.remote_connect_back. 1 = xdebug.scream = 0 xdebug.show_local_vars. 1 =
Restart environment, see phpinfo to see if xdebug installed extensions.
Configuration phpstorm
phpstorm -> perferences -> languages&frameworks -> PHP -> debug
Start phpstorm debug debug
After a successful start, break point, visit the project to see if the successful commissioning.
Debugging
Marked with a breakpoint on the line to debug (click the blank space to the back of the line number, once again points to cancel a breakpoint), it should be noted that when the program runs to the breakpoint, the program will stay in the bank, but the bank itself will not be executed. Since you can see all the data the program runs to contained herein. Of course, the equivalent of using a php function to view information in the var_dump.