Where is PHP.exe?

I’ve been using Visual Studio Code for editing and have Xdebug working fine. I’d also like to enable some other VS Code extensions like for example PHP Intellisense but am having some issues. That one requires a pointer to where the php.exe file is but I’m not able to find that. Is there a variable I can use to set that since it might be different depending on what project I have started at one time?

Any help or nudge in the right direction would be appreciated.

Thanks,
Ben

Does any one have any idea how to figure this out? i.e. where is the php.exe file so I can point to it for things outside of WordPress (like my editor)?

I had one thought which was to install a local version of php.exe somewhere else on my machine but then I have to take on the extra task of keeping the two versions of php in sync.

Any suggestion or advice (however small) would be greatly appreciated.

Thanks in advance,
Ben

Hi Ben,

Local uses Linux binaries so there isn’t a php.exe file.

Your best bet is probably to install the same version of PHP on your PC that your Local site is running.

Doh! Of course. that makes total sense. Thanks a bunch, Clay!!

1 Like

Continuing the discussion from Where is PHP.exe?:

Hi Clay

I am running into the same problem , I was wondering if you could clarify where to install the php files which folder I would need to extract the files to.

I was using Sublime text with no problem and wanted to start using Visual Studio Code but I am getting the php path error and I am stuck. The php zip files has no .exe file or I am missing it and was looking for help
and once installed how do I set the extension path?

Thanks

Hi Jerry,

Can you please provide screenshot of what you’re trying to configure in VSCode?

phpvscode1

I’m having the same problem; this is the error that VS code keeps giving me when I’m trying to save a php file in my local-sites website folder.

But earlier I had just clicked resest somewhere in the settings and it ran html and php code from a php file, so I really don’t understand what its telling me, and I can’t find a php.exe file on my computer (same as Ben mentioned earling in the thread).

If you’re running into this issue and need PHP for validation, see https://stackoverflow.com/a/45240008.

Note that this will be a separate PHP instance than what’s in Local so be sure to choose the version closest to what your sites are running in Local.