Skip to content

PrestaShop error 500: after clearing the cache or in the back office

· The AYT team · 5 min read

Woman in sunglasses holding many shopping bags

A PrestaShop error 500 means PHP stopped with a fatal error before it finished the page. The most common causes, in order: a half-built cache (especially after "Clear cache" or a module install), an incompatible module or override, a PHP version your PrestaShop release doesn't support, and a memory limit that is too low. The first step is always the same: find the real error in a log or in debug mode, then fix that.

Find the real error

The "500 Internal Server Error" page tells you nothing. The real message is elsewhere:

  1. The server's error log. In your hosting panel, look for the site's errors page (or an error_log file). Find the last line with PHP Fatal error: it gives you the file and the line.
  2. PrestaShop's own logs, in the var/logs/ folder (from PrestaShop 1.7.4 on; before that, app/logs/). Open the most recent file and look for CRITICAL or ERROR.
  3. Debug mode. In config/defines.inc.php, change define('_PS_MODE_DEV_', false); to true and reload the page: the error shows on screen. The full steps are in the article on PrestaShop debug mode. Turn it back off once you know the cause, because visitors see the errors too.

The file path in the error usually points to the cause: modules/modulename/ means a module, override/ an override, var/cache/ the cache, and Allowed memory size of … exhausted memory.

Cause 1: a half-built cache

Most often, the 500 error appears right after you clicked "Clear cache" under Advanced Parameters → Performance, after installing or updating a module, or after a move. PrestaShop rebuilds its cache on the first request, and if the rebuild stops (memory too low, time exceeded, a file without write permission), an incomplete cache is left behind and every page fails.

The fix: clear the cache by hand.

  1. Open the shop's folder in the File Manager or over FTP.
  2. Go into var/cache/ and delete the contents of the prod and dev folders. Don't delete the var/cache folder itself.
  3. Reload the shop. The first page loads slowly, because PrestaShop rebuilds the cache.

If you have console access, php bin/console cache:clear does the same. More on the cache in the guide to clearing the PrestaShop cache.

If the error comes back after every clear, the cause is whatever stops the rebuild: check memory (cause 4) and permissions on var/ (cause 5).

Cause 2: a module or an override

If the error appeared after you installed, updated or configured a module, that module is the first suspect. The log usually shows the path modules/modulename/.

  • Without back office access: rename the module's folder in modules/ (for example modulename to modulename-off) and empty var/cache. PrestaShop stops loading the module.
  • With back office access: under Advanced Parameters → Performance, in the Modules section, click Disable next to "Disable non built-in modules" (on 1.7 the option is called "Disable non PrestaShop modules" and sits under Debug mode). If the error goes away, turn modules back on one by one in the Module Manager to find the culprit.
  • Overrides (the files in override/) change PrestaShop's classes and break easily after updates. The "Disable all overrides" option, in the same section, tells you quickly whether the problem is there.

A 500 error only in the back office, with the shop itself working, often comes from a module that hooks into admin pages or from an old back office cache. Empty var/cache first, then check recently installed modules.

Cause 3: the PHP version

Each PrestaShop version has a PHP range: 1.7.8 goes up to PHP 7.4, 8.x up to 8.1, and 9 needs at least PHP 8.1. If your host changed the PHP version (or you did), the shop can return a 500 error on every page. Switch back to the previous version, clear the cache and read the article on PrestaShop 1.7 and PHP versions.

Cause 4: memory and execution time

The message Allowed memory size of 134217728 bytes exhausted (that's 128 MB) means memory_limit is too low. PrestaShop 8 needs at least 256M, and 9 needs 512M. Raise the value in the domain's PHP settings.

Maximum execution time of 30 seconds exceeded shows up during imports, thumbnail generation or a cache rebuild. Raise max_execution_time or split the import into smaller files.

Cause 5: file permissions

After a move or an FTP upload, the var/, img/, upload/, cache/ and config/ folders must be writable by PHP. Otherwise PrestaShop can't write its cache and logs. Folders usually have 755 and files 644. Don't use 777: anyone with access to the server could then change the files.

Cause 6: the database connection

If the values in app/config/parameters.php (server, database name, user, password) don't match the database, PrestaShop doesn't start. It happens after moves or after the database password was changed in the panel. Compare database_host, database_name, database_user and database_password with your hosting panel, and clear the cache after you correct them.

PrestaShop error 500 on AYT hosting

On AYT you see the real error on the domain's Errors page, with the site's error log. For PrestaShop 8 shops, the PrestaShop Toolkit has an "Empty the caches" button under Settings, and on the Commands page you run cache:clear or prestashop:module disable modulename without SSH. You rename or edit files in the File Manager, which has a code editor, switch the PHP version on the panel's PHP versions page, and change memory_limit and max_execution_time in the domain's php.ini editor.

The Errors page with the site's error log

The web server is nginx, so .htaccess rules are not read and can't cause a 500 error. If you can't find the cause, restore the shop from the daily backups, in the panel. See the plans on the hosting page.

More articles

All articles