About how to find your php.exe installed by localwp on Windows

Hey there!

So i’ve been searching for a way to use the php versions installed by LocalWP with composer.

After some research on different forums(like this one), the only approved answer i got was that local was using linux binaries (Where is PHP.exe?) (There is no such thing…Why did someone approved that).

I finally found it, there is 2 places where you can find your php.exe( and other ressources like nginx, appache, mariadb etc.)

  1. C:\Program Files (x86)\Local\resources\extraResources\lightning-services (If installed for all users. If not it is in App Data if i remembers,anyway this one is easy just click on you “Local” shortcut and do “Open File Folder” until you get trough the root Local folder)

There you will find the default ressources that comes already installed by local like:

  • php-7.3.5

  • mariadb-10.4.10

  • Etc…

but you wont find versions that wasn`t natively there like others post installed php versions(like 7.4.1).

  1. C:\Users\[your-user-name]\AppData\Roaming\Local\lightning-services

There you will find those versions:

  • php-7.4.1

  • apache-2.4.43

  • Etc…

So you can even add them to your path or use this for Composer.

I hope it can help you in some way! :slight_smile:

2 Likes

For Mac, the php executable path seems to be something like this:

/Users/results/Library/Application Support/Local/lightning-services/php-8.1.23+0/bin/darwin/bin/php

For any macOS users out there getting an error like this when starting Visual Studio Code:

Cannot validate since a PHP installation could not be found. Use the setting ‘php.validate.executablePath’ to configure the PHP executable.

1 Like