Local Version: > I updated a few minutes ago to the latest Local WP version that is 7.1.2. This PHP configuration error started occuring when Local WP was still 7.1.0 version. I don’t know why all of a sudden this bug appeared and not sure what is the cause
How do I fix it?
Operating System (OS) and OS version:
Microsoft Windows 10 Home
Security Reminder
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.
it still is not clear how I can fix my PHP issue, I am extremely confused
I never used PHP debug extension, and before I started using LocalWP I used wamp and that worked differently
where to find this launch.json file in .vscode from Local public folder?
Where is this Local public folder? I have several websites on my LocalWP and all my websites there use WordPress so PHP too
The only way I could find this launch.json was by opening a JS file in vs code then from the top menu “run without debugging” I picked “Chrome” and I was shown the screenshot I enclosed to this message
should I delete everything in launch.json and this file looks the same no matter what JS file I decide to “run without debugging”, if it is Chrome or anything else ?
is this the launch.json which lines of code have to be removed fully or what files should be deleted ?
Even though you might not be trying to use XDebug, in the process of adding the configuration to VSC, it should point VSC to a server run by XDebug, which in turn points to PHP. Xdebug is acting kind of like a middleman to the PHP.
You could also try to set the php.validate.executablePath to the actual path of the PHP binary we ship - here’s that info:
I installed the LocalWP add-on “Xdebug + VS Code” and enabled and re-launched LocalWP after that
2.I installed “PHP Debug” extension by Xdebug on VS Code
I started one of my websites on LocalWP then > Tools (Tab) > Add run configuration to VS Code
I got the notification that the configuration to VS code was added
(I believe it is here app/public/launch.json)
Then I opened a PHP file on VS Code and clicked on Run > Start debugging
I attached the error message I got
Option 2:
I tried to add to my VS code in settings.json "php.validate.executablePath": "C:\...........\Local\resources\extraResources\lightning-services\php-8.1.9+8\bin\win64"
but this is the error message I got “Invalid escape character in string.”
How to remove these error messages?
I would prefer fixing option 1 as I want to have LocalWP to always be ok with its PHP configuration no matter the version of LocalWP
I checked with one of our Devs on this and they mentioned that you may want to start by removing the php.validate.executablePath from settings.json
From there, double-check that you’re doing the steps from that other thread. So remove and launch.json file in the <sitename>/app/public and <sitename>/app/public/.vscode folders and then re-add the file by clicking in the Local under “Site Overview > Tools > Xdebug + VS Code > Add run Configuration to VS Code”
@Nick-Bphp.validate.executablePath kept recreating itself from settings.json
for anyone else that might have had the same bug, I finally fixed it by replacing the backslash \(that is automatically present when you copy the file path) with forward slash /: