After upgrading or modifying your OpenCart installation, you may encounter a blank screen either in front office or in the administration area.
There are various causes for this issue in OpenCart. Here I’ll describe 3 of the most common ones and how to fix them.
1. PHP errors not being displayed
Hidden PHP errors is one of the most common issue for blank pages in OpenCart.
Production values for display_errors and log_errors PHP directives are Off and On respectively. With such a configuration, some PHP errors will make OpenCart display a blank page with no clue as to what the actual cause of it is and log the errors instead.
To find out the actual error, you’ll need to check your server’s (or PHP) error log for PHP errors. A generic syntax error will look somewhat like this:
[Sun Feb 26 12:48:37 2012] [error] [client 127.0.0.1] PHP Parse error: syntax error, unexpected ‘}’ in /srv/www/dev/opencart/1513/index.php on line 47
Now when you know what the actual error is, you should be able to fix it yourself or find someone to do it for you.
2. Wrong variable values in configuration files
Broken configuration files can cause blank pages in OpenCart as well. If you are getting a blank page and no errors in the log, be sure to double check the config.php and admin/config.php files, paying special attention to DIR_ variables. If your DIR_APPLICATION is not correctly pointing to the catalog/ subfolder, you’ll get a blank page and no errors.
Same applies to DIR_APPLICATION variable within your back office config.php file. It should point to your admin folder or you will get an empty page when trying to access the administration area of your store.
3. Broken directory structure
Although this is a less common cause of blank pages in OpenCart, it is still worth mentioning.
Both back office and front office folders follow the same structure in OpenCart:
/catalog/ or /admin/ - controller - language - model - view
You will get a blank page with no errors if this structure is missing the controller/ folder. For other missing folders OpenCart will usually display an error, so if you aren’t getting any errors, make sure your controller/ folder is intact.
Feel free to post a comment if you think there’s something else that should be on the list.
Latest posts by Martin Boze (see all)
- Black Friday Discounts Are Here & MultiMerch7 for OpenCart2 Pre-Order! - November 28, 2014
- A 5 Minute Look at OpenCart 2.0 - September 17, 2014
- MultiMerch Documentation Updates & Call For Feedback - September 8, 2014