There is a significant difference between the earlier case you found, and your case. The earlier caller had a (separate) WordPress installation on all domains. His AddOn domains was also running WordPress. He could have done exactly what I suggested in my first response. Run all domains as a Multi-Site install.. One WordPress copy, one WordFence copy.
In your case that will not work, because you say your add-on domains are not WordPress installations, but something else.
You are however impacted by one part of WordFence, because of Cpanel’s way of installing things inside each other.
WordFence comes with two parts.
Part one is wordFence-waf.php, actually calling the base boot-strap firewall piece. Testing for intrusions, it hooks itself into PHP through PHP’s “auto_append_file” option (set in php.ini). It is essentially WordPress ignorant. It does not need a WordPress environment. It just scans the initial access information.
By “Auto Prepending” the firewall part through PHP, that piece of code runs BEFORE Wordress starts up.. And in the add-on domains cases, WITHOUT an actual WordPress EVER starting up.
The PHP “auto_append_file” config option can be set in .htaccess, in php.ini or in VirtualHost (apache) settings. Since this part is independent of WordPress (pure PHP), it can run without WordPress for those initial checks.
Part two of WordFence is the whole WordFence plugin itself. This is a WordPress plugin, which does all the other work and blocking and presents you with the control interfaces you see in WordPress’s admin screens. You obviously CANNOT install the WordPress plugin on a non-WordPress type of site. That plugin needs WordPress to run.
So, in your case, what seems to be happening is a side-effect of Cpanel’s idiotic notion of installing add-on domains (really addon Apache VirtualHosts) inside the main domain’s space, instead of keeping all VirtualHost installations separate and parallel, like others do it.
Because you are running all these domains sort of inside each other (add-ons as sub-directories of the root domain), the php.ini or .user.ini sitting in your root-domain’s directory is affecting all your installations.. Just like a global PHP.ini file (global to all PHP installations on the server) would. BUT.. That is where WordFence hooked in it’s initial firewall file.. Ooooopss..
Suddenly you have half of WordFence running, without WordFence really wanting to. The base wordfence-waf.php file is apparently being “prepended” to your supposedly unrelated add-on domains via PHP’s common auto_prepend_file option on the root-domain). Because they all share that directory in their path.
That is why you suddenly see a WordFence warning like the one you show in your picture when you “touch” or try to upgrade on your add-on.. The WAF file is running when you run PHP operations on your add-ons, and it is thinking unsafe things are going on. (Some firewall rule-pattern kicked in.)
You need to separate the PHP “auto_prepend_file” option on your root-domain from affecting your other domains.. You can do this in multiple ways, since that option can be placed in 3 different types of config files. Touching your VirtualHost configs for each is one way, but more tricky.
I would suggest you try to use the .htaccess file in each add-on domain to tell PHP to STOP auto-prepending the unrelated WAF file, since the full WordFence cannot actually be install there.
Put this option in their individual .htaccess file
php_value auto_prepend_file none
Not in the root-domain’s htaccess file, since it IS actually running WordPress and a full WordFence plugin install. Only in the add-on’s private htaccess file.
The “none” tells PHP that you do not want an “auto_prepend_file” here.