Minimize Text   Default    Enlarge Text

I am getting a blank page (or blank part of a page)

Print
Save to list
Subscribe

Blank pages can be caused by a number of things, and often occur just after installing, upgrading, or customizing your store.  Any time you touch a PHP file, you must be sure to not introduce syntax problems, and you need to be sure that it uploaded correctly.

1. Did all your file-uploads work properly?

Sometimes FTP programs experience a timeout when uploading large quantities of files (such as when installing or upgrading your site), or fail to fully upload some files, or leave them as just 0-bytes in size. Some programs like SmartFTP and CuteFTP are well-known to be problematic in this area. For Windows PCs, you'll find FileZilla is a free, fast, and reliable FTP program (but don't save your passwords with it!). On Mac, Transmit or CyberDuck are commonly acclaimed FTP tools.

Best to re-upload and ensure that there are no errors, and that no files are left with 0 bytes.

Failed uploads are the MOST COMMON CAUSE of all website problems.

 

2. Have you created any syntax errors in your customizations?

A PHP syntax error will very often result in a blank screen, or a partially-blank screen.

When this happens, there is often also an entry in the server's errorlog, which you can often view via your hosting control panel area.

a) Turn on debug logging to store errors to a log file

Install the Debug Error-Logging Utility (note: this is ALREADY installed in v1.3.9x)

One way to identify what PHP errors are happening, especially if you have no access to server errorlogs, is to use the Debug Error-Logging Tool from our downloads area.   It's a simple install, and can expose the source of your problems fairly quickly.  Click {here} to download it. (note: it's already installed in v1.3.9x)

If you're dealing with blank admin pages, for the upload destination, substitute the /admin/includes/extra_configures folder instead of /includes/extra_configures where mentioned in the instructions.

The debug tool will create files in your /cache/ folder, named "myDebug-xxxxxx.log" (or "myDebug-adm-xxxxxxx.log" if they are from the admin side).
You'll want to read the contents of these files to see what the actual PHP errors are.
Then search this FAQ area for your error message and/or see the "Dealing with Error Messages" section, below ...

b) Attempt to show errors on-screen.

While the method above is far more reliable and preferable (since messages are never shown to customers), Another way to help identify *where* an error is happening is to show the errors on your browser. The drawback to this is that your customers can also see the errors, and search engines might catch them too ... which could be embarrassing.

To attempt to show PHP debug errors on-screen, create and upload a new file, like this:

Filename:  /includes/local/configure.php

<?php
  define('STRICT_ERROR_REPORTING', true);
?>

Then try to access your site again. You may see many warning messages on the screen. 

Dealing with the Error Messages

The "fatal" messages are the more important ones to deal with.  "Notice" messages can be ignored in most cases.  "Warnings" should draw some attention, but are not fatal.
Also note that many error/warning messages will be a result of previous error/warning messages. 
Deal with them in the order they appear, and don't blame the later errors until the earlier ones are dealt with first.


3. Common customization errors

The most common customization errors include:
  • using ' or " marks inside define() statements, resulting in mismatched quotes
  • removing or adding punctuation to define() statements, thus breaking the correct syntax.   A define() statement should look like this: define('CONSTANT_NAME', 'value here');
  • missing semi-colons and periods, unbalanced parentheses, braces, brackets
  • uploading files to the wrong places.  For more information about overrides, see the Overrides Chart and the Overrides FAQs
 

Other Information
If you are using Yahoo Hosting, you might want to enable their script logs: http://help.yahoo.com/l/us/yahoo/smallbusiness/webhosting/php/php-05.html




Related Articles
Warning: Headers already sent...
Symptom: Warning: Cannot modify header information - headers already sent by (output started at /....includes/something/something/something.php:12) in...
Some of my PHP files are missing the ?> at the end of the file
Symptom The ending ?> seems to be missing in some of my files, esp since upgrading to v1.3.8. With a Diff viewer I can see that in some cases the last line has...
Can I run PHP as CGI on my Linux/Unix webserver?
(Windows servers "always" run PHP as a CGI app, so this FAQ may not apply to Windows hosts.) While Zen Cart is "best" run on a server running PHP as...

 


Copyright © 2003 - 2009 Zen Ventures, LLC
Get Zen Cart E-Commerce Shopping Cart at SourceForge.net. Fast, secure and Free Open Source software downloads