I can’t seem to edit PHP theme files in an active theme in the Theme File Editor. Klicking “Update File” gives a "Something went wrong. Your change may not have been saved. Please try again. There is also a chance that you may need to manually fix and upload the file over FTP.
Editing a not active theme works. Editing non PHP files works. Read somewhere that this could be because of loopback requests not working. So ran Site Health and it says “Your site could not complete a loopback request”
What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc
Edit an active themes PHP files through Theme File Editor.
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.
The error itself is kind of a generic WordPress error that can be a pain to diagnose sometimes. Looking through similar issues in the past it seems to come up more often on Apache so I was hoping switching to NGINX might resolve it.
One other simple thing you can try is if you are using any plugins on your site is disabling all of the plugins to rule out a culprit there.
You can do this quickly by opening Site Shell and running the command wp plugin deactivate --all
Since you’re on Windows you could also check to make sure you don’t have any native security or firewall blockers on your device.
You could also check your browser’s developer tools to inspect network requests while replicating the error. Look for any failed requests and examine the details.
If none of the above fixes work immediately, you should still be able to manually update the PHP file via SFTP as a workaround.
Thanks for the Troubleshoot Windows link. No change though.
The only not standard with this Local install is I changed the Sites path just a bit. Can i change it to standard (which is?) or something else and then change i back without losing my current sites?
Did you change it in your Preferences > New Site Defaults in the Local app? Your default pathing should be something like C > User > Local Sites > Site Name
As a precaution, you can always export your sites and save the copies to reimport should you run into any issues.