Title: Intermittent 500 errors due to php.ini handler custom code
Last modified: March 15, 2020

---

# Intermittent 500 errors due to php.ini handler custom code

 *  Resolved [Pat K](https://wordpress.org/support/users/blackcapdesign/)
 * (@blackcapdesign)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/intermittent-500-errors-due-to-php-ini-handler-custom-code/)
 * This is more of a heads-up than a support question:
 * I recently upgraded PHP & mySQL versions and when logging in to the admin dashboard
   I noticed 2 things:
    1) When moving through the dashboard, pages would randomly
   fail to load properly; just an unstyled white screen with a vertical list of 
   dashboard links 2) I received this helpful notification from BPS:
 * HUD Check: PHP/php.ini handler htaccess code check PHP/php.ini handler htaccess
   code was found in your root .htaccess file, but was NOT found in BPS Custom Code.
 * …followed by a code snippet to be copied & pasted in to the custom code editor:
 * # PHP/php.ini handler htaccess code
    AddHandler application/x-httpd-ea-php73 .
   php .php7 .phtml
 * Excellent (so far)! After I pasted it in & clicked encrypt & save, I carried 
   on working in the admin dashboard. BUT the intermittent page loading problem 
   persisted – only in the dashboard. I checked the source code on one of these 
   broken pages and compared with an unbroken page & the code was the same on both.
   Then I checked the browser debugger and saw this:
 * Failed to load resource: the server responded with a status of 500 (Internal 
   Server Error)
 * …so I disabled script concatenation using the config file (added this to wp-config.
   php):
    define(‘CONCATENATE_SCRIPTS’, false);
 * This worked as a short term fix and suggested this is a plugin-related problem.
   So I removed define(‘CONCATENATE_SCRIPTS’, false); and started disabling plugins.
   As soon as I disabled BPS the problem went away.
 * After MUCH testing, I determined the problem was:
    a) the missing PHP.ini handler
   code AND b) the blank spaces before “AddHandler” in the code snippet provided
   by the BPS plugin.
 * In other words, THIS:
    # PHP/php.ini handler htaccess code AddHandler application/
   x-httpd-ea-php73 .php .php7 .phtml
 * SHOULD be THIS:
    # PHP/php.ini handler htaccess code AddHandler application/x-
   httpd-ea-php73 .php .php7 .phtml
 * I’m not 100% sure this is completely resolved, but so far, so good (no more broken
   admin pages).
    pk

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Thread Starter [Pat K](https://wordpress.org/support/users/blackcapdesign/)
 * (@blackcapdesign)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/intermittent-500-errors-due-to-php-ini-handler-custom-code/#post-12546247)
 * Hmmm. The editor stripped out the blank spaces before “AddHandler” in my original
   post. Just make sure there are no blank spaces before “AddHandler”…and time permitting
   AITpro might consider removing those blank spaces in the helpful code snippet.
 *  Plugin Author [AITpro](https://wordpress.org/support/users/aitpro/)
 * (@aitpro)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/intermittent-500-errors-due-to-php-ini-handler-custom-code/#post-12546389)
 * Are you saying that extra whitespace is being mistakenly added by the BPS Setup
   Wizard when it creates the php.ini handler htaccess code? I’m going to check 
   that now, but yeah I’d like to know (confirm) if that is what you have found.
   Whitespace definitely causes 500 errors with htaccess code/files.
 * Thanks.
    -  This reply was modified 6 years, 2 months ago by [AITpro](https://wordpress.org/support/users/aitpro/).
    -  This reply was modified 6 years, 2 months ago by [AITpro](https://wordpress.org/support/users/aitpro/).
 *  Thread Starter [Pat K](https://wordpress.org/support/users/blackcapdesign/)
 * (@blackcapdesign)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/intermittent-500-errors-due-to-php-ini-handler-custom-code/#post-12546416)
 * No, not by the wizard. I like to do stuff manually, so I have AutoFix turned 
   OFF. I’m talking about the prompt at the top of the admin screen. If that’s copied
   and pasted it adds 2 non-breaking spaces (a tab indent) in the code window.
 * I think it may be a moot point though because I applied this fix on another site
   and was still getting the intermittent broken pages afterwards. Of note, I did
   a ‘wordpress reinstall’ from the WordPress Updates page and this seemed to make
   matters worse. In the short term I’m disabling script concatenation – until I
   have more time to troubleshoot.
 * I’m wondering if caching may be partly responsible…maybe updating the salts for
   the authentication keys in config file?
 * Thanks for following up! If you have any troubleshooting ideas (other than what
   I’ve listed above) I’d be happy to try them!
 *  Plugin Author [AITpro](https://wordpress.org/support/users/aitpro/)
 * (@aitpro)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/intermittent-500-errors-due-to-php-ini-handler-custom-code/#post-12546437)
 * Got it on the manual copy and paste. I use Notepad++ to do a “staged” copy instead
   of copying directly from any browser output and definitely copying anything from
   a Microsoft App like Word or Outlook. By copying something to the (free) Notepad
   ++ App you will see any (hidden) formatting added by your clipboard or when copying
   from a Microsoft App. And then you can correct any formatting issues before copying
   the code/text (from Notepad++) into a BPS Custom Code text box.
 * Yep, I was going to mention that typically caching causes intermittent errors.
   If you want me to check your site on the frontend I’d be glad to do that. You
   can either post a link to your site here or email it to me using my contact page
   form > [https://www.ait-pro.com/contact/](https://www.ait-pro.com/contact/)
 * Also if you want to check for any errors that give you some clues then launch
   the Google Chrome Browser > hit your Ctrl+Shift+I keyboard keys to launch GC 
   Dev tools > click the Console tab in the GC Dev tools window and check for any
   errors.
 *  Thread Starter [Pat K](https://wordpress.org/support/users/blackcapdesign/)
 * (@blackcapdesign)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/intermittent-500-errors-due-to-php-ini-handler-custom-code/#post-12546456)
 * Excellent! Thanks for the tips!! I’ll do some more testing and when I figure 
   this out, I’ll post back here.
 *  Plugin Author [AITpro](https://wordpress.org/support/users/aitpro/)
 * (@aitpro)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/intermittent-500-errors-due-to-php-ini-handler-custom-code/#post-12945125)
 * Resolving old thread.
 *  Thread Starter [Pat K](https://wordpress.org/support/users/blackcapdesign/)
 * (@blackcapdesign)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/intermittent-500-errors-due-to-php-ini-handler-custom-code/#post-12959864)
 * Thanks for the reminder. I still haven’t figured this one out. If / when I do,
   I’ll be sure to report back here.
    pk
 *  Plugin Author [AITpro](https://wordpress.org/support/users/aitpro/)
 * (@aitpro)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/intermittent-500-errors-due-to-php-ini-handler-custom-code/#post-12960650)
 * A php/php.ini handler would not cause any of the problems that you are experiencing.
   Try reinstalling WordPress. Go to the Dashboard menu > Updates menu > click the
   Re-Install Now button to reinstall WordPress. Deactivating the BPS plugin would
   only do 1 thing and that would be to decrease your php memory resource usage 
   by around 3MB. So maybe you are maxed out on php memory? You can check that on
   the BPS System Info page. You should have at least 128M minimum for your php 
   configuration memory limit. 256M is the optimum php configuration memory limit.
   You PHP Memory Usage should be between 20M-100M depending on how many plugins
   you have installed.
    -  This reply was modified 5 years, 11 months ago by [AITpro](https://wordpress.org/support/users/aitpro/).
    -  This reply was modified 5 years, 11 months ago by [AITpro](https://wordpress.org/support/users/aitpro/).

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Intermittent 500 errors due to php.ini handler custom code’ is closed
to new replies.

 * ![](https://ps.w.org/bulletproof-security/assets/icon-128x128.png?rev=1731938)
 * [BulletProof Security](https://wordpress.org/plugins/bulletproof-security/)
 * [Support Threads](https://wordpress.org/support/plugin/bulletproof-security/)
 * [Active Topics](https://wordpress.org/support/plugin/bulletproof-security/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/bulletproof-security/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/bulletproof-security/reviews/)

## Tags

 * [500 error](https://wordpress.org/support/topic-tag/500-error/)
 * [handler](https://wordpress.org/support/topic-tag/handler/)
 * [php.ini](https://wordpress.org/support/topic-tag/php-ini/)

 * 8 replies
 * 2 participants
 * Last reply from: [AITpro](https://wordpress.org/support/users/aitpro/)
 * Last activity: [5 years, 11 months ago](https://wordpress.org/support/topic/intermittent-500-errors-due-to-php-ini-handler-custom-code/#post-12960650)
 * Status: resolved