The path to a php executable
Try this !!!. This will solve your problem for sure!
Method 1 -
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.
In VS Code
Open 'settings.json' file and put the below codes.
If you are using WAMP put this code and Save.
If you are using XAMPP put this code and Save.
Note - Replace php7.1.9 with your PHP version.
Nobody likes errors, least of all computer programmers!
If you are a PHP developer and recently installed Visual Studio Code (VS Code), then you are most likely getting a pesky "PHP executable not found" error message every time you start the program.
Some of the other VS Code error message you will see with the PHP executable not found message includes:
With every single one of these VS Code error messages, you simply need to update your Windows PATH setting for your PHP executable location. Doing that will fix all of these PHP executable errors!
How to fix PHP executable not found error in VS Code
Step 1: Install php on your computer (e.g. with XAMPP)
The first and very most important step to fix the PHP executable not found error on Visual Studio Code is to actually have PHP installed on your computer. Now that might seem like an obvious starting point, but you would be surprised how many people don't have PHP installed on their local web dev environment (e.g. their localhost server).
Personally, I have always been a fan of the XAMPP suite by ApacheFriends.org. I have been using the XAMPP suite to install PHP, MySQL, and phpMyAdmin for my localhost web servers for years. I highly recommend.
Step 2: Locate your php installation directory
Once you have PHP installed on your local computer (as part of your localhost server), you need to find the PHP installation directory. As we need the folder path that holds your php.exe file.
If you installed XAMPP, simply browse to your XAMPP installation directory. The default location is at C:\xampp. From inside the XAMPP folder, open the PHP folder and locate the php.exe file. If you can find the php.exe file from in this folder, then this folder will be your php installation directory.
Step 3: Open Advanced System Settings on Windows
Now that we know your php installation directory, we need to open the actually add the folder path into the Windows' PATH. But to get there, you have to open a few different screens.
From the your file explorer or desktop, right click on "This PC". Then select "Properties" from the drop down. Doing this will open the Windows control panel menu for your system settings.
From the system settings menu, you will see all of your computer's basic information like RAM, CPU size, and your computer name.
On the left hand side of the program, you will see an option to open "Advanced System Settings". Go ahead and open the Windows advanced system settings program.
Please note: this WILL require you to have administrative permissions on your Windows computer. If you do not, then you will have to contact the person that does in order to update the Windows PATH variable.
Step 4: Update the Windows "PATH" environment variable
Once you have successfully found and opened the Windows advanced system settings popup, you can edit your Windows environment variables. While selected to the Advanced tab in the popup, click on the "Environment variables..." button at the bottom. This will open another program.
From here you can update all of your Windows environment variables. But in order to fix the PHP executable not found error message in VS Code, we really only care about the PATH variable.
So, from the list of User variables, select the "Path" option. Then click the Edit button. This will open the variable editor window.
Inside of the variable editor window, you can create a new PATH variable quite easily. Simply click the "New" button on the right hand side. Then enter in your PHP installation directory that we got from the step above.
Be sure to click away from the new path you created to ensure the updated PHP path is correctly saved into Windows.
Step 5: Close VS Code and reopen it
When you have successfully saved your PHP path location into the Windows PATH variable, you can close out of all of the Windows control panel windows.
You can now close VS code and reopen it. And you will notice that you have gotten rid of the the "PHP executable not found" error message that you get on VS code start up. Great success!
Where is php EXE file?
Php.exe is located in a subfolder of the user's profile folder —common is C:\Users\USERNAME\AppData\Local\php7\. Known file sizes on Windows 10/8/7/XP are 28,739 bytes (57% of all occurrences) or 106,496 bytes. The program has a visible window. It is not a Windows system file.
How set php executable path in VS code?
“how to set php path in vs code” Code Answer /* File->Preferences->settings->User settings tab->extensions->from the drop down select php->on the right pane under PHP › Validate: Executable Path select edit in settings.
Where is php executable Linux?
How add php validate executable path in VSCode?
Use the setting 'php. validate. executablePath' to configure the PHP executable..
First of all. Open settings. ... .
CRTL+SHIFT+P. type ext install PHP Debug and install the first match. ... .
How install php add on path?
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 xampp?
The default location is at C:\xampp. From inside the XAMPP folder, open the PHP folder and locate the php.exe file. If you can find the php.exe file from in this folder, then this folder will be your php installation directory.