Title: HTTP ERROR 500
Last modified: February 9, 2024

---

# HTTP ERROR 500

 *  Resolved [mohammedkadhim](https://wordpress.org/support/users/mohammedkadhim/)
 * (@mohammedkadhim)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/http-error-500-232/)
 * Hello,
 * I’ve been using WordFence for years with no problem until today after updating
   PHP from 7.4 to 8.1 I got HTTP ERROR 500 on both front end and even on WordPress
   dashboard.
 * After going through all plugins one by one it turned out that WordFence was causing
   this issue.
 * Tried to manually uninstalling WordFence and all of its data and tables then 
   installed the plugin again this time the site worked until I ran the Firewall
   optimization process again I started getting HTTP ERROR 500.
 * Stripping user.ini and htaccess from WordFence codes also seem to fix the problem
   but then this means the Firewall is not optimized which is not what I want.
 * What could be the problem?
 * Kindly note that sometimes when I get HTTP ERROR 500 I keep refreshing the page
   4 to 6 times the site works temporarily but then again when I refresh once more
   it shows ERROR 500 again. Very strange!
 * Kind regards,
 * Mohammed Kadhim

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

 *  Plugin Support [wfpeter](https://wordpress.org/support/users/wfpeter/)
 * (@wfpeter)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/http-error-500-232/#post-17412171)
 * Hi [@mohammedkadhim](https://wordpress.org/support/users/mohammedkadhim/), the
   last part does sound strange.
 * The error 500 with .user.ini/.htaccess usually suggests that the `auto_prepend_file`
   path to **wordfence-waf.php** doesn’t match its actual location. Having said 
   that, it would be an issue until it was modified or removed rather than intermittent.
 * If you’ve checked the path there is definitely correct, it’d be great to see 
   your diagnostic report. Send it to **wftest @ wordfence . com** directly from
   the link at the top of the **Wordfence > Tools > Diagnostics** page. Then click
   on **“Send Report by Email”**. **Please add your forum username where indicated
   and _respond here after you have sent it._**
 * **NOTE:** It should look as follows – Screenshot of [Tools > Diagnostic > Send by Email](https://www.wordfence.com/wp-content/uploads/2021/09/diagnosticsendbyemail.png)
 * Thanks,
   Peter.
 *  Thread Starter [mohammedkadhim](https://wordpress.org/support/users/mohammedkadhim/)
 * (@mohammedkadhim)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/http-error-500-232/#post-17412477)
 * [@wfpeter](https://wordpress.org/support/users/wfpeter/)
 * Thank you for the reply.
 * Indeed!, it either working fine or doesn’t. Can’t be something in middle. But
   as strange as it sound, when I get error 500 I keep refreshing the page a couple
   times and it work. But again when I refresh once more the website stops again.
 * Also not sure why this happened after going from php 7.4 to 8.1.
 * Regarding Diagnostics data, I’ve already sent it to the email you suggested yesterday.
   But also sent the data once more a couple moments ago including my forum username“
   mohammedkadhim” just so that you can easily find it.
 * Kindly note that currently WordFence is enabled but without optimization since,
   as mentioned, it will break the website.
 * Appreciate your help,
 * Mohammed Kadhim
 *  Plugin Support [wfpeter](https://wordpress.org/support/users/wfpeter/)
 * (@wfpeter)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/http-error-500-232/#post-17412999)
 * Hi [@mohammedkadhim](https://wordpress.org/support/users/mohammedkadhim/), thanks
   for sending that over.
 * Some of our information about server platform, timeouts etc. is obtained from`
   phpinfo()` but I see that is disabled. There don’t appear to be incorrect or 
   strange values from what I can see, but without optimization and the extra PHP
   information it might be hard to diagnose.
 * Do you have any other functions besides phpinfo in the `disable_functions` section
   of your **php.ini** file? If you’d be willing to do that and temporarily re-optimize
   the firewall, we might be able to see if anything stands out. You can set everything
   back again immediately after sending the diagnostic once again with your forum
   username.
 * Thanks,
   Peter.
 *  Thread Starter [mohammedkadhim](https://wordpress.org/support/users/mohammedkadhim/)
 * (@mohammedkadhim)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/http-error-500-232/#post-17414640)
 * [@wfpeter](https://wordpress.org/support/users/wfpeter/)
 * Thanks for your reply.
 * The problem is fixed and it wasn’t an issue with WordFence and I’ll explain below
   how it got fixed.
 * When I updated PHP to 8.1 Apache got bugged and started randomly throwing error
   500 especially when executing resource intensive process such as the Firewall
   optimization process by WordFence.
 * All I had to do is restart php_fpm and Apache and things are working fine now.
   I managed to optimize WordFence without issue.
 * Big thanks to you in fact I wouldn’t go through these steps without you notifying
   me about phpinfo() which wasn’t disabled in phpini but only then I realized that
   the server is bugged and needed restart.
 * Thank you!

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

The topic ‘HTTP ERROR 500’ is closed to new replies.

 * ![](https://ps.w.org/wordfence/assets/icon.svg?rev=2070865)
 * [Wordfence Security - Firewall, Malware Scan, and Login Security](https://wordpress.org/plugins/wordfence/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordfence/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordfence/)
 * [Active Topics](https://wordpress.org/support/plugin/wordfence/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordfence/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordfence/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [mohammedkadhim](https://wordpress.org/support/users/mohammedkadhim/)
 * Last activity: [2 years, 3 months ago](https://wordpress.org/support/topic/http-error-500-232/#post-17414640)
 * Status: resolved