The inability to save or edit main theme PHP files, especially after successful upgrade to WordPress 4.9 and higher. However, an absolute and instant fix has been tested and provided, based on my research.
This article helped me out, via https://prexblog.com/error-fixed-wordpress-inability-to-edit-and-save-theme-php-files/
And am free.
Go to your Plugins and install new plugin called “Theme editor“, this will allow you edit and save your themes PHP file codes comfortably without using the FTP as requested by the WordPress version. Additionally, you can also use “WP Editor” plugin to fix the issue.
You can as well see the full tutorial via https://prexblog.com/error-fixed-wordpress-inability-to-edit-and-save-theme-php-files/