Microsoft VS Code: When I try to launch my program error “spawn php ENOENT” shows up

柔情痞子 提交于 2020-05-15 02:57:31

问题


I am trying to run PHP code on Microsoft VS Code. When I click launch the only thing that happens is an error in the debug console saying "spawn php ENOENT".

To fix this, I have put the dll file for XDebug into the ext folder. I copied php.ini-development into a new file called php.ini and in that file I added this to the end of the file.

zend_extension="[file path]" xdebug.remote_enable = 1 xdebug.remote_autostart = 1

This changed nothing.

Then, I added an inbound rule for my firewall to allow inbound connections on port 9000. Still, nothing changed. How can I fix this.


回答1:


What fixed it for me, was adding this line to user settings:

"phpserver.phpPath": "c:\\Ampps\\php-7.1\\php.exe"

Your path may vary. (-> error occurs, because your php is not found)

phpserver: This is because I use the PHP Server extension. If you use a different extension, you need a different parameter.



来源:https://stackoverflow.com/questions/49240957/microsoft-vs-code-when-i-try-to-launch-my-program-error-spawn-php-enoent-show

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!