VSCODE所在系统 WINDOWS
远程SSH (101) CENTOS7
远程PHP PHP 5
调试环境:
端口8889
调试地址:
https://192.168.0.101:8889/api/home/accessCount
调试方法:
远程SSH上操作
1 安装xdebug扩展,此处2.5
2 配置php.ini确保xdebug被启用。参考VS Code的PHP XDEBUG插件的说明
其中远程端口设置为9003
3 命令验证
php -r "phpinfo();" |grep xdebug
其中,
xdebug.remote_port => 9003 => 9003
4
启动nginx
启动php-fpm
此处nginx使用php-fpm作为fastcgi,配置是这样的
location ~ \.php$ {
root /x/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
5 从本端访问
https://192.168.0.101:8889/api/home/accessCount
访问成功
本端WINDOWS
6 打开VS code
7 在VS code安装php debug扩展
8 查看php debug扩展的使用说明
TOBEDONE.