Support » Fixing WordPress » Theme editor cannot edit PHP files

  • Resolved RavanH


    Hi, when trying to use the WordPress theme editor to edit a theme PHP file, I get this message upon trying to save:

    Unable to communicate back with site to check for fatal errors, so the PHP change was reverted. You will need to upload your PHP file change by some other means, such as by using SFTP.

    I suspect it has something to do with my particular VPS installation but how to debug this? I’m not seing related errors in the log file…

Viewing 9 replies - 1 through 9 (of 9 total)
  • Moderator Steve Stern


    Support Team Volunteer

    Please install the health check plugin and report back its findings:

    It has an auto-troubleshooting mode for the loopback issue, but the problem (since you have a VPS) is probably in the write permissions. It will tell you about that, too.

    Hi Steve, I checked on another install (this one on a shared host) and there it occurs too. Will check again with the health check plugin after making sure it is multisite compatible…

    So I installed Health Check on the multisite running on shared hosting. Activated it on the main site (not network wide) and then did an attempt to modify a theme template file again.

    Health Check does not report anything unusual I think:

    PHP Version: 7.1.9 - For performance and security reasons, we strongly recommend running PHP version 7.2 or higher.
    MySQL Server version: 5.5.55-0+deb7u1-log - For performance and security reasons, we strongly recommend running MySQL version 5.6 or higher.
    JSON Extension: Your PHP install supports JSON.
    MySQL utf8mb4 support: Your MySQL version supports utf8mb4
    Communication with is reachable from your server.
    HTTPS status: You are accessing this website using HTTPS.
    Secure communication: Your WordPress install can communicate securely with other services.
    Scheduled events: No scheduled events have been missed.
    Background updates:
     No version control systems were detected.
     Your installation of WordPress doesn't require FTP credentials to perform updates.
     All of your WordPress files are writable.
    Loopback request: The loopback request to your site completed successfully.

    Debug info says all file permissions are OK.

    What should I be looking for exactly?

    • This reply was modified 1 year, 8 months ago by  RavanH.
    Moderator Steve Stern


    Support Team Volunteer

    Rats. Nothing there. Let me ask some of the other mods who might know multisite.

    Moderator Steve Stern


    Support Team Volunteer

    A couple more questions:

    Are you editing the theme that is running on the main site? May be some odd logic there because multisite admin runs on main site, but other sites are what it really is editing and wants to check

    Also domain mapping: if you’re multisite, the other sites might have different domains. Basically I need details on what you’re editing, where you’re editing it, and where it runs.

    Ow, you’re right! I tried editing another (inactive) theme and that works fine… It’s only the theme that is active on the main site where this issue occurs!

    Bug in WordPress multisite?

    Moderator Samuel Wood (Otto)

    (@otto42) Admin

    Possibly. Some of the support people are looking into it and running some tests. Multisite doesn’t come up quite as often, it may be a valid bug.

    Moderator Samuel Wood (Otto)

    (@otto42) Admin

    Made a ticket for this issue:

    Thanks @otto42 🙂

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Theme editor cannot edit PHP files’ is closed to new replies.