Are you experiencing WordPress HTTP Error 500? In case you’ve come across such problem shown above, don’t panic and carefully follow the steps below. In fact, it’s just as easy as 1-2-3! So, let’s proceed below for the actual procedure.
9 Steps to fix WordPress HTTP Error 500
Step 1: First of all, Log-in through FileZilla. Indicate your website name (host)– you can use either the IP or the website name itself (e.g. “websitename.com”). Also, don’t forget the username, password, and the port number.
Finding the wp-config.php:
There are two (2) steps you can follow to find where the wp-config.php is located. The instruction is indicated below.
- In the remote site tab click “/” and then click the ”var” folder. Once done, locate the “www” and click it also. Finally, click the “html” folder and there you’ll find the wp-config.php.
- Here’s an another easier and quicker way: simply type “/var/www/html/” on the remote site tab and press enter – there you have it!
Step 2: Right-click on the “wp-config.php” file and click “view/edit”. Once finished, locate: “define(‘WP_DEBUG’, false);”. Now, change the false value to true. E.G. define (‘WP_DEBUG’, true); After that, save the file and close the wp-config.php folder.
Step 3: Go to your website. Here, you can see what are the errors and where is the error located. This is commonly caused by the theme itself. Now proceed and locate the theme by typing this on the remote site tab: “/var/www/html/wp-content/themes”.
Step 4: Click the theme (indicated on the previous picture where the error is situated) and find “functions.php”. Once found, right click and press “view/edit”.
Step 5: As indicated on your website, the error is on line 60. Now browse through and find: if ( $wpdb->get_var(‘SELECT count(*) FROM `’ . $wpdb->prefix . ‘datalist` WHERE `url` = “‘.mysql_escape_string( $_SERVER[‘REQUEST_URI’] ).'”‘) == ‘1’ ). To make it easier for you to find it – press CTRL + G on your keyboard, type 60 and press enter.
Step 6: Once found, just add a letter “i” in the “mysql_escape_string”. e.g. if ( $wpdb->get_var(‘SELECT count(*) FROM `’ . $wpdb->prefix . ‘datalist` WHERE `url` = “‘.mysqli_escape_string( $_SERVER[‘REQUEST_URI’] ).'”‘) == ‘1’ ). Now, save and close the folder.
Step 7: You’ll see this message after saving and closing the functions.php folder. So, Just click Yes and proceed to the next step below.
Step 8: Go back to the wp-config.php folder and just like the previous step, find: “define (‘WP_DEBUG’, true);”. But this time, change the true value to false. E.G. “define(‘WP_DEBUG’, false);”. In addition, don’t forget this one to avoid the hidden errors from showing up on your website.
Step 9: Here’s what you’ll see once you forget to follow and do the Step 8. Your website is back – that’s great – but the hidden errors make it look unsafe and corrupted. So, as much as possible, don’t forget the Step 8 to achieve the best result!
And there you have it, folks – congrats! Now, you’ve successfully fixed the WordPress HTTP Error 500 by following only 9 simple steps.
Jomari Reyes says
This is an awesome way. This is the easiest, i recommend it!