Bobcares

7 causes for PrestaShop white page, and how to fix it

by | Mar 27, 2018

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.

 

SPEED UP YOUR SERVER TODAY!

Never again lose customers to poor page speed! Let us help you.

Contact Us once. Enjoy Peace Of Mind For Ever!

GET EXPERT ASSISTANCE

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

1 Comment

  1. Kuba

    It can also happen when PHP max_execution_time is set too short.

    Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF