Can`t Edit

I always get this message (Could not reconnect to site to check for fatal errors, so PHP changes have been reverted. You will have to upload your PHP change file in some other way, such as using SFTP.) When changing code in my theme
Why and how to solve it?
Thank you very much

Hey @muslih

Can you describe in a little more detail where this is happening?

  • For example, is this over a Live Link?
  • Where are you seeing this error when it appears?
    • The customizer?
    • A page-builder?
  • Can you provide a screenshot of the browser window when you see this error?

Is this over a Live Link? No
Where are you seeing this error when it appears? Theme editor>functions.php
Can you provide a screenshot of the browser window when you see this error? this is a screenshot:
Thank you

I’m having trouble replicating this on a plain WordPress site.

Can you try creating a new, plain WordPress site in Local and try editing the functions.php file for the active theme?

I’m curious if this is something specific to this machine and/or network, or if there’s an issue with this specific site.

Thank you for your advice
However, I have tried it and it still doesn’t work

It’s hard to say why that is happening. It’s possible that this is due to some sort of antivirus software blocking or throttling the connection back to the WordPress site.

I’m curious – since this is a Local site, is there a particular reason that the edits are being made through WordPress?

Because Local is an offline development tool, all of those files are on the computer, which means you can open them with a dedicated text editor like VS Code.

You should be able to edit the theme’s functions.php file by right-clicking on the site in Local and clicking “Reveal in Finder”. From there, navigate down into wp-content/themes/whatever-theme-is-active and then open the functions.php file.

Can you try opening and editing the file outside of WordPress to see if that file is accessible with the correct permissions?

Can I use this plugin: to edit it?
Thank you very much

Sorry, why is there no answer?

Maybe! I’d say give it a try!

In general, I would recommend editing files in the Local site with a dedicated text editor, but you can try anything to work the way that works best for you!

1 Like

Don’t use that plugin. There are/have been recent security issues with it.

1 Like

Hi, isn’t my website inaccessible? would it be dangerous to use that plugin?
And whether the plugin has not been fixed yet?

All the files on you Local site are on your computer. The safest and best way to edit them is to do it directly in a text editor or IDE as suggested by @ben.turner above.

It’s your website, you can use whatever tools you wish. I’m only trying to provide some additional information you may wish to consider.

So, can I edit it via notepad?

Yes, any text editor will work.

Ok, thank you