-
-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: spawn php ENOENT on Macos #705
Comments
I use PHP installed by Now I have to explicitly specify the PHP path to run the extension properly. The configuration is as follows: {
...,
"runtimeExecutable": "/opt/homebrew/bin/php"
} |
I'm sure the problem occurs at L261, which discards |
Hi! Thanks for a comprehensive bug report! Although I know that currently setting I'm currently a bit limited on my abilities to test things on MacOS, so can you please try the following for me:
If the code change isn't what solves the problem, and you can't get VS Code to find php in your path you can also use the |
ok, the following is the default configuration: Next, I'll remove the The debugging process starts normally. Finally, I'll update the extension code and undo the By merging environment variables, the extension can find |
Thank you for testing this... I'll do the same tests on my end to confirm linux and windows and will prepare a release. It might be a few days before I can push an release out though. |
Hi. I went and tested this on all 3 systems. I occurred to me that what you are describing here doesn't normally happen. I went and looked at the documentation again:
So what I am suspecting is happening to you is that the php command being executed is some sort of proxy executable that uses the path to find the right one... But again, as said before, the behavior and the patch should be merged and released. |
Well, I have looked through the
Then, after v14.13.1, it was changed to the following prompt:
But my node version is |
const { spawn } = require("child_process");
const command = "php";
const args = ['-v'];
const env = { };
console.log("With env: \n");
const stream = spawn(command, args, { env });
stream.on('error', function () {
});
console.log("\nWithout env:\n");
spawn(command, args, { }); uh. I run the above code with $ NODE_DEBUG=child_process node hello.js
It turns out that Nodejs does not append |
The documentation change seems to be only language ("will be" to "is"). I went and researched a bit the node code, trying to confirm what the documentation states.
However I was not able to find this logic and ended up down in https://github.com/nodejs/node/blob/c61870c376e2f5b0dbaa939972c46745e21cdbdd/deps/uv/src/unix/process.c#L337 On Linux and OSX it uses the execvpe/execvp system calls. https://linux.die.net/man/3/execvp and https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/execvp.3.html What the documentation states here is:
So not Since your PHP is in Let me just reiterate, the fix you proposed is still valid and will be applied as soon as possible. Thanks! PS: |
I proposed a doc change nodejs/node#41418 and we'll see if there was something I misunderstood. |
PHP version:
v7.2.34
Xdebug version:
v3.0.4
VS Code extension version:
v1.22.0
Your launch.json:
Xdebug php.ini config:
Xdebug logfile (from setting
xdebug.log
in php.ini):VS Code extension logfile (from setting
"log": true
in launch.json):Code snippet to reproduce:
The text was updated successfully, but these errors were encountered: