以下是在Ubuntu上使用PHPStorm调试功能的步骤:
sudo apt-get update和sudo apt-get install php-xdebug,若使用特定PHP版本,需安装对应版本扩展,如sudo apt-get install php7.x-xdebug。/etc/php/{php_version}/cli/php.ini或/etc/php/{php_version}/fpm/php.ini,添加zend_extension=xdebug.so、xdebug.mode=debug、xdebug.client_host=127.0.0.1、xdebug.client_port=9003、xdebug.start_with_request=yes,保存后重启PHP和Web服务器。File > Settings,在Languages & Frameworks > PHP > Servers中添加新服务器,设置主机名、端口等;在Languages & Frameworks > PHP > Debug中确保Xdebug启用且端口正确。Shift+F9,选择服务器配置后启动,代码执行到断点时会暂停,可查看变量、逐步执行代码等。