A 500 error prevents your customers from accessing the pages of your online store. And of course, this anomaly will have repercussions on your e-commerce business. Which is why you should take action as quickly as possible to resolve the problem. In this article, find out what causes a Prestashop 500 error, and what you can do to make your sales pages accessible again.
What is a 500 Prestashop error?
If your store displays the error message 500, it means that the server is experiencing an internal failure. This is an error code returned by the web server. In most cases, this anomaly occurs following an update or the installation of a module. Note that this error message can take various forms, depending on the type of server. Here are a few examples:
- Error 500
- 500 Error
- HTTP error 500
- HTTP ERROR 500
- Error 500 – Internal server error
- HTTP 500 – Internal Server Error
- Error 500 (Internal Server Error)
- 500 Internal Server Error
This message is usually followed by a sentence like “The server has encountered an internal error”.
Possible causes of a 500 error on a Prestashop store
A 500 Prestashop error message doesn’t appear by chance on your e-commerce site. Here are the most common causes of this error:
1- Server response time exhausted
A 500 Prestashop error can result from a waiting time that is too long. Each server has its own maximum time limit for executing scripts. These may include importing SCV files, backing up, loading translations or regenerating images. Error 500 will occur when the execution time of these scripts exceeds that imposed by your store’s host. By default, this time is usually 30 seconds.
2- Incorrect configuration of the .htaccess file
Most 500 errors are due to incorrect configuration of the .htaccess file. This bug is triggered in particular when there is a syntax error in this file. An erroneous character inevitably leads to the display of a 500 error.
3- Permission problem
Please note that 777 authorizations have many weak points that can affect the internal operation of your web server. This explains the error message.
4- Obsolete modules
For security reasons, we recommend that you regularly update your Prestashop store. This also enables you to take advantage of new features that boost your site’s performance. Please note, however, that this action can lead to obsolete modules, which more often than not result in a 500 error. For example, a change in version of Prestashop can lead to incompatibility between your old modules and the new version. As a result, certain pages of your online store are not displayed.
5- Incorrect module settings
A 500 error on Prestashop can also be due to incorrect module settings. In most cases, this type of problem results from the installation of a new module.
How to resolve a 500 Prestashop error?
The method for resolving a 500 Prestashop error differs depending on the source of the problem.
1- Advanced debugging of a 500 error
Before you can resolve a 500 error, it’s useful to identify it precisely. PrestaShop’s Debug mode offers a quick and efficient way of detecting the source of the error. Follow the steps below to activate it:
- For PrestaShop versions 1.5.3 and newer, edit the `defines.inc.php` file in the `/config/` folder and change `define(‘_PS_MODE_DEV_’, false);` to `define(‘_PS_MODE_DEV_’, true);`.
- For earlier versions (1.4 to 1.5.2), open `config.inc.php` and replace `@ini_set(‘display_errors’, ‘off’);` with `@ini_set(‘display_errors’, ‘on’);`.
Activating this mode displays detailed error messages in your PrestaShop interface, facilitating diagnosis.
2- 500 Prestashop error due to long waiting time
If the error is caused by a script’s loading time running out, simply extend the execution time. To do this, you can modify a line of code by following the instructions below:
- Go to your Cpanel’s PHP settings.
- Modify the line of code that determines the script execution time: max_execution_time (change the default setting of 30 seconds to a longer time).
- Reset the default value once the script has finished (this helps secure your site against hacking).
If you can’t access these settings, your best bet is to contact your online store’s hosting service.
3- Error 500 caused by missing PHP modules
Some PHP modules are essential for PrestaShop to function properly. Modules to check include :
- Mcrypt
- OpenSSL
- Zip
- Curl
- GD
- PDO
To check their presence, create a `phpinfo.php` file with the following code, place it in your root directory, then consult it via your browser:
```php
<?php phpinfo(); ?>
```
After verification, delete this file for security reasons.
4- Error 500 caused by PHP memory limitations
PrestaShop requires a minimum PHP memory allocation for uninterrupted operation. Many hosting providers limit this memory to 128 MB, which may not be sufficient for intensive tasks such as data import. Increase the memory limit to 256 MB, or 512 MB for VPS servers. This can be done via the `php.ini` file or by contacting your hosting provider.
5- Error 500 resulting from a misconfigured .htaccess file
A misconfigured `.htaccess` file can also trigger internal errors. To solve this problem, make a backup of the existing file and try to regenerate it:
- Log in to the PrestaShop administration panel.
- Go to “Preferences” > “SEO & URLs”.
- Deactivate then reactivate the “Simplified URLs” option to recreate the `.htaccess` file.
This resets redirection rules and other configurations, eliminating potentially associated errors.
6- Error 500 from file authorization
777 permissions offer little protection and leave your store vulnerable to hacker attacks. If your current configuration displays a 777 permission, consider changing it to 755 or 644. Shell code can be added to the article for advanced users wishing to automate this correction in their site tree. Use the following commands to update the permissions in your site’s root directory (to be adapted according to your access path):
find /home/USER_NAME/public_html -type d -exec chmod 755 {} ;
find /home/USER_NAME/public_html -type f -exec chmod 644 {} ;
Note, however, that folder permissions differ from one hosting provider to another. It is therefore advisable to contact your hosting provider for information on file and folder permission rules.
7- Prestashop 500 error and obsolete modules
If you’re experiencing a 500 error due to out-of-date modules, you can remedy the situation by updating all your modules. To do so, visit the Prestashop Addons marketplace for up-to-date modules compatible with your version of Prestashop.
8- Error 500 caused by incorrect module settings
If you encounter this server-side problem after installing a new module, try renaming the module in question. Installing a new theme or plugin can also generate an internal server error. If this is the case, remember to uninstall it before clearing the browser cache. Note: once the 500 Prestashop error has been corrected, don’t forget to deactivate error reports.
Additional resources and tools for dealing with a 500 error
Using server logs
If the error persists and Debug mode doesn’t provide sufficient details, consult the server’s error logs. On Apache servers, these are usually found in the directory `/var/log/apache/error.log`. Analyzing these logs can provide specific information on errors and their causes. Remember to delete old logs regularly to avoid clogging up your server’s storage space.
Recommended video for more information
Youtube offers numerous tutorials on how to manage 500 errors in Prestashop. For example, this video shows you step-by-step how to activate debug mode and manage permissions and configuration errors.
To conclude on the 500 Prestashop error
A 500 error is an anomaly that can scare off potential customers, who simply can’t take any action on your Prestashop store. To solve this problem as quickly as possible, try one of the solutions presented in this article. What if the problem persists despite these solutions? In this case, don’t stay behind your screen on your own, or you’ll be wasting your time and creating more serious bugs. Instead, consider enlisting the services of a Prestashop expert. With several years’ experience in Prestashop development, I can help you solve the problem that’s preventing you from selling on your store. Don’t hesitate to contact me to describe the problems you’re experiencing with your online store. I’ll be happy to help you find the most appropriate solution.