IDE: VS Vode Server:phpStudy2018 切换为PHP-7.0.12-Nginx版本
1. 其他选项菜单→PHP扩展及设置→PHP扩展→勾选Xdubug
2. 打开配置文件PHP.ini 注意对应版本 修改文本末尾
-
xdebug.profiler_output_dir="D:\phpStudy\PHPTutorial\tmp\xdebug" xdebug.trace_output_dir="D:\phpStudy\PHPTutorial\tmp\xdebug" zend_extension="D:\phpStudy\PHPTutorial\php\php-7.0.12-nts\ext\php_xdebug.dll" xdebug.remote_port = 9001 xdebug.remote_autostart= On xdebug.remote_enable = On
注意xdebug.remote_port = 9001,xdebug.remote_port这个设置,默认是9000,但fast-cgi的默认端口也是9000,Nginx使用的fast-cgi端口也是9000,所以修改为9001。经本人测试如不修改也不抛错,debug时浏览器会卡住不动,不能正常访问项目。
3. VS Code 文件→首选项→设置→用户设置 User Settings文件修改PHP可执行文件配置
-
"php.validate.executablePath": "D:\\phpStudy\\PHPTutorial\\php\\php-7.0.12-nts\\php.exe",
注意