Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP executable not found. Install PHP 7 and add it to your PATH or set the php.executablePath setting

I'm running windows 10 fresh copy and I just installed visual studio code. I was trying to develop a PHP project using VS Code. But I'm having trouble in setting up the environment.

I saw a blog post and I downloaded the binary file of PHP 7 and place it in the "C" drive. Then I set path variable too.

But still, I'm getting this issue.

enter image description here

like image 535
Nifal Nizar Avatar asked Oct 27 '16 14:10

Nifal Nizar


People also ask

How do you solve PHP executable not found install PHP 7 and add it to your path or set the PHP Executablepath setting?

Step 1 - Go to 'Environmental Variables'. Step 2 - Find PATH variable and add the path to your PHP folder. Step 3 - For 'XAMPP' users put 'C:\xampp\php' and 'WAMP' users put 'C:\wamp64\bin\php\php7. 1.9' ) and save.

Where is PHP EXE file in xampp?

On a Linux or Mac OS X system, this may be available as the file /usr/bin/php. If you've installed XAMPP, you can use the program /opt/lampp/bin/php on Linux, /Applications/xampp/xamppfiles/bin/php on Mac OS X, and C:\Program Files\xampp\php\php.exe on Windows.


2 Answers

You installed PHP IntelliSense extension, and this error because of it.
So if you want to fix this problem go to this menu:
File -> Preferences -> Settings
Now you can see 2 window. In the right window add below codes:

{     "php.validate.executablePath": "C:\\wamp64\\bin\\php\\php7.0.4\\php.exe",     "php.executablePath": "C:\\wamp64\\bin\\php\\php7.0.4\\php.exe" } 

Just like below image.

enter image description here

NOTICE: This address C:\\wamp64\\bin\\php\\php7.0.4\\php.exe is my php7.exe file address. Replace this address with own php7.exe.

like image 125
ops Avatar answered Sep 21 '22 19:09

ops


For those who are using xampp:

File -> Preferences -> Settings

"php.validate.executablePath": "C:\\xampp\\php\\php.exe", "php.executablePath": "C:\\xampp\\php\\php.exe" 
like image 31
Sahin Erbay Avatar answered Sep 21 '22 19:09

Sahin Erbay