O
O
Obolduy2020-12-12 13:21:12
PHP
Obolduy, 2020-12-12 13:21:12

How to set correct path in VSCode phpvalidateexecutablePath?

Hello, I am facing the following situation. I'm learning PHP (7.1), writing in Visual Studio Code and using OpenServer, until recently I didn't feel the need for debugging and terminal, ignoring them. Now I started working with Composer, libraries and frameworks, so the need for a terminal and debugging appeared. I installed the PHP Debug extension, Xdebug seems to be the same (Then it turned out that it was already preinstalled in OpenServer). I fixed everything that is required in php.ini and settings.json, but VSC keeps saying: "Cannot check because C:\Users\username\Program Files (x86)\OpenServer\modules\php\PHP_7. 1\php.exe is not a valid PHP executable Use the php.validate.executablePath option to customize the PHP executable." I fight without exaggeration the third day. The line itself in settings.

"php.validate.executablePath": "C:\\Users\\имяюзера\\Program Files (x86)\\OpenServer\\modules\\php\\PHP_7.1\\php.exe"

If we assume that I didn’t mess up at the time of specifying the path (I indicated it several times in every way - to no avail) and that my version of PHP in OpenServer matches the folder I refer to (It seems that I went through everyone - the result is the same), then it comes to mind only one option comes up - OpenServer does not allow the studio to access folders without administrator rights. Okay, I fixed the access in the properties of the OpenServer-a root folder so that now (sort of) it works without admin rights, but the Code still can't access it. There were no such problems with Python in the summer, it still hangs in the json file
"python.pythonPath": "C:\\Users\\имяюзера\\AppData\\Local\\Programs\\Python\\Python38-32\\python.exe"
- and no one swears, everything works. I would be very grateful for the help, because I did not find any working recommendations for myself.
upd: the solution is more or less found, if anyone has a similar problem, see the comments

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pychev Anatoly, 2020-12-12
@Obolduy

Try adding the path to your php file to PATH, and I added both for the user and globally. Run the terminal anywhere and execute php -v
And yet, if I remember correctly for OpenServer, it does not recommend editing the php.ini files that are located next to the php executable file, because he can change them and your settings will fail.
the rest should work fine

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question