PrestaShop shop stuck on a 500 error or blank page
A blank page or a 500 error on PrestaShop tells you nothing on its own: it's a symptom, not a diagnosis. You need the real error messages to know whether the problem is a module, an override, the database or the server.
The situations I handle
- Completely blank screen when loading the front end or back office
- 500 error appearing right after a module or PrestaShop update
- 500 error on certain pages only (product page, cart, checkout)
- "The file config/settings.inc.php is missing" message after a hosting transfer
- 500 error triggered after a manual edit to an override file
- Site works locally but errors once deployed on the production server
How I go about it
-
Enabling debug mode
I set _PS_MODE_DEV_ to true in config/defines.inc.php to reveal the real PHP or Smarty error message instead of the generic blank page.
-
Reading the logs
I check the server's PHP logs (often in error_log or the Apache/Nginx logs) and, on PrestaShop 1.7/8, the var/logs/ folder, which holds the Symfony errors.
-
Isolating the culprit
I disable modules one by one via the ps_module table or FTP, and check the override/ folder for a file conflicting with the core.
-
Checking the server
I check the PHP version, active extensions, memory_limit and write permissions on var/cache, var/logs and config, all common causes after a hosting change.
-
Fixing and clearing the cache
Once the cause is identified, I fix the file or reconfigure the server, then clear var/cache/prod (or cache/smarty on 1.6) before switching debug mode back to false.
PrestaShop blank page: where it appears tells you where it comes from
Before even reading the logs, note where the blank page or 500 error occurs. It halves the search area.
- Front office and back office both blank: the failure happens before PrestaShop tells them apart. Look at the configuration: PHP version changed by the host, an incomplete
app/config/parameters.php(1.7, 8, 9) orconfig/settings.inc.php(1.6), an invalid.htaccess, missing write permissions. - Back office only: often a cache left over from a previous version in
var/cache/, or a module hooked into the admin. - Front office only, or a single page: a module attached to a display hook, a theme file, or data specific to that page.
- Only at checkout: the payment or carrier module, which is only called at that step.
If the page stays blank while _PS_MODE_DEV_ is on, the error happens before PrestaShop has loaded: read the server’s PHP error log, not var/logs.
The most common error messages, and what they point to
Cannot declare class …orCannot redeclare class …: a duplicated override, or one left behind after a module was uninstalled. Deleting the class index —var/cache/prod/class_index.phpon 1.7 and later,cache/class_index.phpon 1.6 — makes PrestaShop rebuild it.Allowed memory size of … bytes exhausted: PHP’s memory limit has been reached, typically during an import, thumbnail regeneration or indexing.Call to undefined function each()orcreate_function(): a module written for an old PHP version. Both functions were removed in PHP 8; see moving PrestaShop to PHP 8.SQLSTATE[42S02]: Base table or view not found: a table is missing, after a migration, an interrupted SQL import or a badly uninstalled module.Link to database cannot be established: wrong database credentials in the configuration file, or the MySQL server is down. See database connection error.Permission deniedonvar/cacheorvar/logs: write permissions lost, common after an FTP transfer or a change of host.
The most common causes
On PrestaShop, a 500 error is rarely random. The cases I run into most often:
- A badly written or duplicated override file between
override/and a module, causing a class to be redeclared. - A PHP version incompatibility after a hosting upgrade (a module using a function removed in PHP 8, for instance).
- Missing write permissions on
var/cache,var/logsorconfigafter an FTP file transfer. - A corrupted
.htaccessfile or an invalid rewrite rule, breaking routing before PrestaShop even runs. - A missing or corrupted database table following a migration or an interrupted SQL import.
On 1.6, the blank page often hides a Smarty error in the compiled cache (cache/smarty/compile) that wasn't cleared after a theme update.
define('_PS_MODE_DEV_', true);
Related pages
-
Enabling PrestaShop debug mode
The exact steps for each version, and how to switch it off afterwards.
-
Reading PrestaShop error logs
Where the logs live and how to spot the line that matters.
-
Product page will not save
When the error only appears when saving a product in the back office.
-
Module refuses to install
Installation error, disappearing module: the causes in the files and in the database.
-
Payment method gone after an update
When the failure is confined to checkout.
-
Recurring errors: repair or rebuild?
On an old version, when every fix calls for another.
Describe your need in one minute
A few targeted questions so I can reply with an estimate rather than another questionnaire.