Question
Why am I seeing 'php_flag not allowed here' errors in my Apache logs?
Answer
If you are seeing errors in your Apache error log that say php_flag not allowed here this is due to your .htaccess file containing an invalid line.
Here is what the full error looks like:
[Tue Apr 27 00:06:39.577293 2021] [core:alert] [pid 88612:tid 47191269926656] [client 11.22.33.44:42906] /home/user/public_html/.htaccess: php_flag not allowed here, referer: http://yourdomain.tld/
If you check the .htaccess file you will see a line similar to the following:
php_flag display_errors Off
You can remove that line or comment it out by adding a # to the beginning of the line.
#php_flag display_errors Off