/    Sign up×
Community /Pin to ProfileBookmark

PHP Errors returning ERROR 500

By default when I have a PHP my server shows me a ‘HTTP ERROR 500’ and doesn’t display the page etc.

how can I fix this, it’s a pain to troubleshoot.

to post a comment

4 Comments(s)

Copy linkTweet thisAlerts:
@SempervivumOct 01.2020 — Yes, error 500 can be annoying as there is no information given about the type and location of the error.

One way to work around this is using an editor the supports hightlighting of syntax errors like visual studio code and a PHP extension for it.
Copy linkTweet thisAlerts:
@NogDogOct 01.2020 — You can see if this gives you any output, though you don't want display_errors turned on on a live site, as it can display stuff you don't want certain nasty people to see.
<i>
</i>&lt;?php
ini_set('display_errors', true); // turn off in production
error_reporting(E_ALL);
Copy linkTweet thisAlerts:
@HarshShahOct 23.2020 — @kiwis80#1623822 This is an internal server error. refer to this article it helps you to resolve it. https://www.slothparadise.com/fixing-500-internal-server-error-php-file/
Copy linkTweet thisAlerts:
@VITSUSAOct 23.2020 — @kiwis80#1623822 The 500 Internal Server Error is perhaps the most annoying error you can encounter. In many instances, you can easily resolve the issue by applying the process outlined in this KB. Note that essentially, there is nothing wrong with the server itself.

Note: Before making changes to the site’s code and database, it is always a good practice to take a full backup of the server, so that you can restore the site in case something goes wrong.

Resolving 500 Internal Server Error requires you to follow this process:

**Step 1**: Debugging the Issue - You need to check PHP logs (part of Apache error logs) for more information about the error.

ini_set('display_errors', 1);

ini_set('display_startup_errors', 1);

error_reporting(E_ALL);

**Step 2:** Check if the Admin Works

**Step 3**: Revert Recent Changes - If your dev team pushed changes just before the 500 error was reported, you should try to revert back to the last available version. This way, you could eliminate a very probable source of the error.

**Step 4**: Audit Your Plugins/Extensions/Modules - In general, the error occurs because of the compatibility issues caused by outdated plugins/extensions/modules or poorly coded new ones. In this context, you might encounter the error after installing a plugin/extension/module.

**Step 5**: Check File Permissions

**Step 6**: Increase PHP Memory Limit

**Step 7**: Debug .htaccess Issues - In many cases, rules in .htaccess file can also cause 500 Internal Server Error.
×

Success!

Help @kiwis spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...