Generally, PrestaShop back office error 500 happens when trying to access the Back-office while Debug mode is active or while production mode active.
The characteristic of this error is that it only occurs in one of the modes and not in both.
Most PrestaShop administrators experiences this issue when starting an update of the website theme or modules from your PrestaShop online store.
Usually, this error is seen in PrestaShop Stores Version 1.7 and that makes it impossible for us to enter the Back-office, showing an error 500 or the page goes blank.
Below are some of the most common error messages seen:
1. "Error 500 (Internal Server Error)".
2. "Error 500 – Internal server error".
3. "Internal server error".
4. "HTTP ERROR 500"
5. "Error 500"
6. "HTTP Error 500"
Common causes for PrestaShop back office error 500 are given below:
1. Permission error
2. Incorrect configuration of the .htaccess file
3. Waiting time has expired
4. Obsolete modules
In PrestaShop 1.7 stores, unlike version 1.6, a series of cache files are created located in two "prod" (production mode) and "dev" (Debug mode) folders, depending on the PrestaShop mode being used.
These cache files help to speed up PrestaShop in each of the chosen modes.
We can find these files in the following two directories depending on the Version of PrestaShop:
If a programming code error exists, it will be written to the cache files corresponding to the mode that is currently being used.
We can activate our web host's FTP or CPanel error reports in the PrestaShop shop.
There are 2 ways to enable these reports, depending on the version we are using:
a. PrestaShop v1.4 to v1.5.2
1. Firstly, open config/config.inc.php
2. And find the line: @ini_set(‘display_errors’,’off’);
3. We need to replace it with: @ini_set(‘display_errors’,’on’);
b. PrestaShop v1.5.3 and later versions (including 1.6 and 1.7)
1. Firsly, open config/defines.inc.php
2. And find the line: define(‘_PS_MODE_DEV_’, false);
3. Replace it with: define(‘_PS_MODE_DEV_’, true);
Finally, we can browse our store’s front or back office to find out the issue.
Once the source of the problem is known, basically the solution is to clean and delete all PrestaShop cache files that contain the two folders “dev” and “prod”.
Generally, these files do not get automatically deleted from the “Empty cache” option. Hence we need to remove or clean it manually.
Here, you will see the method in order to fix the PrestaShop back office error 500.
1. Fixing Permission error
In many cases, this error occurs due to wrong folder permissions.
To correct this error, we need to set the folder authorization to 755 instead of 777 (or vice versa).
2. Correcting configuration of the .htaccess file
Internal server problems like 500 errors often arise when we configure the .htaccess file wrongly.
In PrestaShop, the problems are generally will be related to URL re-writing options and activating "friendly URLs".
We can back up the .htaccess file and restore it from the back office or disable friendly URLs.
A .htaccess file's format is very strict and even an incorrect character or command could cause an internal 500 server error.
Therefore, from the "friendly URLs" option, indicating "NO" could be a solution (do not forget to save the changes).
3. How to fix 'Waiting time has expired' ?
Each server has its own waiting time, which determines how long a script will run.
If the function or script exceeds this time limit, we will receive a 500 error.
Here are the PrestaShop scripts that may take too long to load:
1. Importing CSV files
2. Backup files
3. Loading translations
5. Regenerating miniature views
Generally, the server time limit is 30 seconds, which is not enough for these scripts.
If it is not so, we can ask our hosting provider to change this setting at least temporarily.
4. Reviewing addons to fix Obsolete modules
While updating the shop from version 1.6 to version 1.7, we may encounter obsolete modules or modules that are incompatible with this new version of PrestaShop.
This may also generate 500 errors.
We need to review all the Addons we have previously installed or at least those that are available in a more recent version.
So that we can find out what causes the incompatibility.