A blank page appears when you access a PHP website on a Cloud Web Hosting instance

更新时间:
复制 MD 格式

When you access a PHP website on a Cloud Web Hosting instance, a blank page may be displayed. This issue can be caused by incorrect database configurations, program errors, or cache issues. This topic describes how to resolve this issue.

Problem description

A blank page is displayed when you access a PHP website on a Cloud Web Hosting instance.

Causes

This issue can be caused by the following:

Solutions

Choose a solution based on the cause of the issue.

Important
  • Before you modify a file, create a backup to prevent data loss. For more information, see Back up and recover data.

  • When you modify database information, use a dedicated text editor, such as EditPlus. Using a basic text editor, such as Notepad, can cause encoding errors.

Incorrect database configuration information

Check the database profile to ensure that the database information is correct. The following table lists the database profiles for common open source programs.

Open source program

Database profile

WordPress

wp-config.php

Discuz!

  • config/config_global.php

  • config/config_ucenter.php

DedeCMS

data/common.inc.php

ThinkPHP

common/convention.php

Ecshop

data/config.php

UCenter

data/config.inc.php

UCH

config.php

EmpireCMS

e/class/config.php

ShopEX

config/config.php

Joomla!

configuration.php

HDWiki

config.php

PHPWind

data/sql_config.php

PHPCMS

include/config.inc.php

.NET

web.config

  • If the database information is incorrect, correct it.

  • If the database information is correct, check for program errors or cache issues.

Program errors

Add error_reporting(E_ALL) to the beginning of the PHP file that is displaying the blank page. When you access the page again, a specific error message is displayed. Use this message to debug the program.

The following code provides an example:

<?php
error_reporting(E_ALL);
?>

Cache issues

  • Some programs may cause a blank page if the cache files are too large. In this case, the website backend is usually still accessible. You can log in to the backend to clear the program cache.

  • Some programs generate a static page when the website is accessed. During this process, the home page file (index.html) may be created as an empty 0 KB file, which causes a blank page to be displayed. To resolve this issue, delete the generated index.html file. Then, access the website again to regenerate the home page file.