一、下载xdebug,适合自己版本的
https://xdebug.org/download.php,你需要仔细分析和选择要下载的对应版本,否则无法调试。
建议进入网页 https://xdebug.org/wizard.php,然后将自己phpinfo()输出的信息全复制拷贝
到该网页信息框里,让xdebug官方系统为你选择合适的版本。
二、安装xdebug
wget https://xdebug.org/files/xdebug-2.9.7 .tgz
tar zxvf xdebug-2.9.7 .tgz
cd xdebug-2.9.7
/usr/local/php7.3/bin/phpize
./configure --enable-xdebug --with-php-config=/usr/local/php7.3/bin/php-config
make && make install
cd /usr/local/php7.3/etc/
三、vi php.ini 粘贴以下内容到尾部
[xdebug]
zend_extension=xdebug.so
xdebug.remote_enable=1
xdebug.remote_connect_back=0
xdebug.remote_host=erp.dev.com #此处一定要和自己本地域名一致
xdebug.remote_port=9003 #端口,9002-9010 随意选一个,只要别被其他应用端口占用即可
xdebug.remote_log=/tmp/xdebug.log
xdebug.idekey=PHPSTORM #和PHPSTORM一致
xdebug.auto_trace=1
xdebug.remote_handler=dbgp
xdebug.remote_cookie_expire_time = 3