I created my website in PHP on localhost, but when I upload it to a live server like cPanel or hPanel, I get a blank page. My PHP website works perfectly on localhost using XAMPP or WAMP without any issues, but it doesn't work on a live server such as cPanel or hPanel.I have tried many solutions, but none of them resolved my problem. After uploading my website to live cPanel or hPanel hosting, it doesn't display any content in the browser.
I am using Hostinger hPanel and GoDaddy cPanel hosting. I also contacted the Hostinger and GoDaddy support teams, but they couldn't resolve my issue.
Why am I getting the White Screen of Death (WSOD) in PHP?
Why am I getting a blank page error on cPanel or hPanel?
This is a very common issue when you upload your website to a live server (cPanel or hPanel hosting). I faced the same experience when I was a beginner in coding and programming. I also faced this issue when I uploaded one of my PHP website projects from localhost XAMPP to cPanel hosting (or HPanel hosting). The project was working perfectly on XAMPP and WAMP, but after uploading it to the live server, the browser only showed a completely blank white page. There was no error message, no warning, and no output. It was showing a super clean blank page without any symbol, error or comma.
At first, I thought my website had crashed, but after debugging it, I found that the website wasn't actually broken because it was working on the local server without any issues. The real problem was that the live server was hiding all PHP errors. This is called the PHP White Screen of Death (WSOD) or the Blank Page Error.
After facing this problem on several projects, these are the methods that helped me find and fix the issue. Many beginners and developers face the same issue during the project deployment process. Let’s discuss how you can fix this PHP White Screen of Death (WSOD) or the Blank Page Error.
If your hosting provides cPanel, you can enable PHP error messages without writing any code.
Now refresh your website.
If you are using Hottinger hpanel, you can enable the PHP display error feature by following these steps:-
Now, instead of a blank white page, you'll see the actual PHP error along with the file name and line number where the problem exists. Once you fix that error, your website should start working again.
Some hosting providers don't have the Select PHP Version option. Instead, they provide MultiPHP INI Editor.
If your website is processing large files, increase the memory_limit from 128M to 256M or 512M.
Save the changes.
After refreshing the website, you'll usually see the actual PHP error instead of the blank page.
If you don't want to enable error display on your live website, you can check the PHP error log.
Open File Manager in cPanel.
If you don't see it, enable Show Hidden Files from the File Manager settings.
Open the file and scroll to the bottom.
In most cases, you'll find the latest PHP error with the file name and line number.
For example:
PHP Fatal error: Call to undefined function...
in /public_html/index.php on line 45
This tells you exactly where the problem is.
If you don't have access to cPanel and you're uploading files using FTP or FileZilla, you can enable error reporting directly in PHP.
Open your index.php or config.php file and add the following code immediately after the <?php tag:
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
Save the file and refresh your website.
The hidden PHP error will now appear on the screen instead of the blank white page.
Bonus Tip for WordPress Users
If you're using WordPress and suddenly get a White Screen of Death, the problem is often caused by a plugin.
Go to:
If the website starts working, one of your plugins is causing the issue.
Rename the folder back to plugins, then activate each plugin one by one from the WordPress dashboard until you find the faulty plugin.
This is a very common method by which we check that the PHP version on localhost should be the same as the PHP version on the cPanel or hPanel of the live hosting. Suppose the PHP version on your local server is 7.1, but the PHP version on the cPanel or Hpanel of the live server is 8.2, then you will also see a blank page.
To solve this, we will have to set the same PHP version.
In cPanel hosting –
Log in to your cPanel.
For example –
Execute your website.
In hPanel Hosting –
Now, you will see three options: PHP version, extensions, PHP options.
Click on PHP version and check the PHP version. If the PHP version is different from the localhost server PHP version, then change it to the same localhost server PHP version 7.4.
If you don’t find any select PHP version option in your hosting, then check for Use MultiPHP INI Editor and select the PHP version to change.
From my experience, the White Screen of Death is usually caused by hidden PHP errors, syntax errors, fatal errors, incorrect file paths, missing files, plugin conflicts, a different PHP version on the localhost and live server, or insufficient PHP memory.
The first thing I always do is enable display_errors or check the error_log file. Once the actual error becomes visible, fixing the problem becomes much easier.
One important thing to remember is that after fixing your website, you should disable display_errors again. Showing PHP errors on a live website is not recommended because it can expose sensitive information about your application.