As an Server Administration Service provider, we often get support requests from Prestashop owners.
A common error we’ve seen is the “Prestashop white screen” or the “Prestashop blank page“.
There are many reasons for this error to happen.
Listed here are the top few causes we’ve seen, and how we’ve fixed them.
1. Memory limit
By far the most common reason for the “White screen of death” is Prestashop hitting the PHP memory limit.
Depending on your default server configuration, the memory allowed for PHP process might be limited to 32 MB, 64 MB or 128 MB.
Prestashop requires at least 128 MB to function, and some addons can take more memory than that. A good setting would be “256 MB”, or “512 MB” if you have a VPS.
There are many ways to increase PHP memory size.
The safest way is to edit the php.ini file in our website account. [ Note: Your host needs to enable this feature. ]
Edit the php.ini file, and change the “memory_limit” setting to “512 M”.
If php.ini is not present in your account, you can do this using .htaccess. Add this line to your .htaccess file.
php_value memory_limit 512M
If you are not sure how to do this, or if editing is disallowed in your account, our Prestashop experts can help you fix this. Click here to submit a support request. We are online 24/7.
2. Wrong file & folder permissions
The second most common reason for “Prestashop white page” is wrong permissions set for files and folders.
This is especially true for servers in which SuPHP or Fast-CGI is enabled.
For Prestashop to work correctly, these permissions need to be set:
- 755 – For folders
- 644 – For files
In some old servers, PHP files might be configured as CGI, and would require 755 permissions, but those conditions are rare.
If you suspect the file or folder permissions might be wrong, rest the permissions for the whole Prestashop directory.
For example, in cPanel/WHM servers, we use these commands to reset the file and folder permissions:
find /home/USERNAME/public_html -type d -exec chmod 755 {} \; find /home/USERNAME/public_html -type f -exec chmod 644 {} \;
If you are not sure how to reset the file and folder permissions, click here to request support. Our Prestashop experts are online 24/7.
3. Corrupted files or wrong encoding
PHP scripts can be a bit demanding when it comes to stray spaces or wrong file encoding.
Ideally, your PHP scripts should be saved and uploaded in ANSI file format.
But, depending on your text editor, it might save the file in UTF-8, which the PHP compiler won’t understand.
It is also possible that in your attempt to change something, you have accidentally introduced a space before the initial “<? php>” tag.
The best way to solve this is to download a fresh copy of Prestashop, and replace recently changed files.
If you’ve made extensive changes to your files, you’ll need to manually check the file formats and comb for syntax errors.
If you find that difficult, don’t worry. We can do it for you in a few minutes. Click here to open a support request to our Prestashop experts. We’re online 24/7.
4. Coding error in recently installed/updated module or theme
Prestashop addons (themes and modules) help you setup a shop just like you imagined.
But the downside is that some of these themes and modules might not be well maintained.
Many times we’ve seen some module using deprecated functions, or incorrect code, causing Prestashop to display the white screen.
So, if the white screen was shown after you recently installed or upgraded a new addon, try deleting that addon folder from backend. It should be located in the “/themes/” or “/modules/” folder in your Prestashop’s public_html.
If you are unable to find out which addon caused the error, we can fix that for you. Click here to open a support request to our 24/7 Prestashop support team.
5. Missing PHP modules
For Prestashop to function, it needs these PHP modules:
- Mcrypt
- OpenSSL
- Zip
- Curl
- GD
- PDO
In some servers, especially if you have a VPS, one or more of these modules might not be installed.
We’ve also seen cases where it is installed, but not enabled in the PHP configuration file.
To check if these modules are enabled for your website, copy the below code into a file called “phpinfo.php” and upload it to your site. Then take it in a browser, and check for these extensions.
<? phpinfo(); ?>
If any of those modules are missing, check your server’s php.ini to see if it is enabled. If not, you’ll need to install them.
That can get a bit technical. If you suspect PHP modules are missing in your server, click here to request support from our Prestashop experts. We can fix that for you in a few minutes.
PS: Remember to delete the phpinfo.php file once you are done. You don’t want hackers to know your PHP config details.
6. Database connection limit
In a couple of stores we’ve seen the error “PrestaShop Fatal error: no utf-8 support. Please check your server configuration“.
It might look like UTF-8 support isn’t enabled in the server.
But in reality, it is just Prestashop unable to run a database query.
Some servers have database query limits (eg. 10,000 queries per hour). Any query above that limit wouldn’t be sent to the MySQL database, and it’ll show the UTF-8 error.
Of course it is also possible that the UTF-8 encoding in your database might be changed due to some reason.
If you have a VPS, you can fix this by changing the “max_questions” variable in the MySQL configuration file to “0” (means unlimited).
If you need help fixing the database limits, our Prestashop experts are online 24/7. Click here to open a support request.
7. Stale cache, incorrect .htaccess and many others
There are a lot of other reasons why Prestashop can display a white page. Some of them are:
- Stale cache : Old pages could conflict with the new recompiled pages. To fix, disable the cache, and run a force recompile.
- .htaccess errors : Syntax errors in .htaccess files, especially those used to pass PHP variables can cause compilation errors.
- Security settings : Some security settings such as mod_security limits can cause the execution to fail. It’ll need to be found out by looking at the web server logs.
- Many more : Basically anything that blocks the proper execution of Prestashop files can cause this error. If none of these seem to fit your issue, you’ll need to enable Error Reporting.
What to do if none of this works?
Here at Bobcares, we troubleshoot issues by following an evidence trail.
In the case of Prestashop, if a white page shows up, we will find ways to make it display an error. We’ll then check the associated log entries and find an actual error such as:
“Warning: Cannot modify header information – headers already sent”
This gives us a hint about what’s wrong, and we’ll look at the next location. Since we’ve been doing this for many years now, we usually follow this trail of evidence in a matter of minutes.
If you want to give it a try yourself, start by enabling error reporting in Prestashop.
- Find the file config/defines.inc.php in your Prestashop directory.
- Change
- define(‘_PS_MODE_DEV_’, false);
- to define(‘_PS_MODE_DEV_’, true);
You’ll then start seeing errors in the page instead of a white screen.
If all that sounds gibberish to you, don’t worry, we can help. Our Prestashop experts can help you fix any error in a matter of minutes. Click here to open a support request to our 24/7 support team.
PS 1 : If you have Prestashop version older than 1.5.3, you’ll need to change define(‘_PS_MODE_DEV_’, false); to define(‘_PS_MODE_DEV_’, true); instead of the above setting.
PS 2 : This mode is disabled by default to prevent hackers from knowing your site configuration. So, revert the setting as soon as possible.
Conclusion
Prestashop has error reporting disabled by default for security reasons. So, you’ll see Prestashop white page if something goes wrong in either executing the PHP scripts or in fetching the database values. Today we’ve seen the top 7 reasons for Prestashop blank page, and how to fix it.
It can also happen when PHP max_execution_time is set too short.