Blank Pages in OpenCart: Most Common Causes

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.

20 Comments

  1. Hi,
    Thank you for the valued information.

    My website was migrated from 1 server to another recently and i have shifted the code and DB from old server to the new one. It was hosted on windows server initially and nw i have switched to linux.

    I checked for these 2 errors / issues you mentioned above, with my install.
    But config files and folder structure is correct.

    I have re-installed opencart and uploaded old db and files which i have modified. I am using a custom theme.

    Can you please tell me what else can cause this issue? Can this be a database issue?

    • Martin Boze (Author)

      It shouldn't be caused by the database directly. If your configuration and directory structure are correct then it's probably errors not being displayed. I can't think of any other cause of this.

  2. Mohsin Rafiq

    Hi.

    I was using a linux server when creating opencart site, now customer purchases a windows based hosting. It is problematic for me now. I am seeing blank page although the URL redirects towards login.

    http://www.ourstockinhand.com/index.php?route=account/login

    Please tell me where can i be wrong? I have changed directories paths but no all in vain....

    • Martin Boze (Author)

      Have you solved your issue? If everything else fails, you have to go for low-level debugging, line by line.

  3. Annie

    Hi,

    I have been battling this blank page issue for days. I'm trying to install OC on Mamp Pro. Joomla, Magento and WP install without issue so I feel confident this is not a Mamp, phpmyadmin or MySql error.

    This is what the error log says: [17-Jul-2012 00:06:33 UTC] PHP Notice: Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-store WHERE REPLACE(`url`, 'www.', '') = 'http://xxx.com.au/'' at line 1Error No: 1064SELECT * FROM sec-store WHERE REPLACE(`url`, 'www.', '') = 'http://xxx/' in /Applications/MAMP/htdocs/secrets/system/database/mysql.php on line 49.

    I am just a designer, not a programmer or even very good with code. I am at a total loss to know what to do with this. I cannot find anyone who can help. No-one on the OC Forum bothers to respond.

    Do you have any idea where I can find a php person who can help???

    • Martin Boze (Author)

      Does it happen during installation? It looks like some MySQL issue specific to your store. We might be able to debug and fix it if you mail us more details.

  4. Hello,

    I moved my website from one domain to another en now i get a blank page. I checked the config.php but everything seems fine. The link to the administration area is working. What did i do wrong?

    • Martin Boze (Author)

      If you're totally sure your new configuration is correct, you'll need to check your server logs for errors.

  5. Adem

    Hi everyone, after 2 weeks of frustration and determination not to go through a whole new install again I think I have a solution, how general it will be I am not sure but it certainly has worked for me.

    I noticed a problem from the start with my "Cart" on homepage not loading and after some searching I discovered this was a problem with the way I installed Opencart on my site, without the "www" so I done a search on google for "opencart cart not updating on homepage" and found a thread that pointed me in the right direction, by simply adding rules to make the site redirect from http://www.mysite.com to mysite.com

    I also noticed that for some strange reason, possibly the Notepad I used but the start of the "config.php" in the root folder had a "space" before the syntax of <?php so I deleted this, also the same for the "config.php" in my admin folder.

    Everything is fully working now and have fixed my issue. I just had to say something as I know how frustrating this is.

    All the best

  6. umair

    Although i am new in opencart . I also face this problem so Sometime blank pages in opencart due to vqmod. Usually it is session error. You need to install a new fresh copy of VqMod whenever change your server. also replace old index file with newly downloaded (Uninstalled) copy of opencart. For more help and share your knowledge contact me.

    • This problem has to do with vqmod as suggested. this worked for me.
      but in my case, i simply uninstalled an unused vqmod script and that was it.

  7. This page has the most useful information on Opencart errors that I could find anywhere. I have actually referred this page to my hosting company to try & resolve the issues. I am surely going to bookmark this on and will surely share this with all my friends.

  8. The almond tree is a native tree originating from Asia and the Middle East.
    The oil is chock full of nutrients which help overall health, in addition to that of the hair.
    Sometimes these patches tend to get itchy, and of course
    there's the temptation to scratch, but this only makes the problem worse and increases the chance of infection.

  9. Well, consider the following : an off site upgrade from 1.5.2.1 to 1.5.5.1, had a blank front page, yet admin worked. Turns out the server need php-mcrypt, after installing that, problem solved. It would be an idea to integrate that as a factor in your article, possibly php functionality.

  10. Jeremy

    Hi,
    I currently have a blank page problem in the plugin I'm developing. I've already checked all of the causes described on this page and it's not any of them. After I call $this->render(), the contents of $this->output will be the page I'm trying to create but it never appears on the browser.

    • affect (Author)

      You need to output the response in some way. By default, it's $this->response->setOutput($this->render()). Alternatively, you could pass it via AJAX (if it's a dialog you're building, or something).

  11. Diego Medina

    One more reason.

    1- It start by seeing an error that the image.php script failed to allocate memory .... Something like:

    Fatal error: Allowed memory size of 31457280 bytes exhausted (tried to allocate 10000 bytes) in ...public_html/system/library/image.php on line 73

    So you may go ahead and increase the memory that each php script can use.
    Then you get a blank page with no response body (it is a request that end up aborted)

    2- The solution in my case was to go into the Admin panel -> Image and change the biggest size from 10000 x 10000 to 1000 x 1000

    Thanks for this page!

  12. I just solved another issue with a white screen, which was related to Suhosin blocking PHP execution:
    After moving my OpenCart project from my Ubuntu dev notebook to our Debian web server, it showed a blank screen.
    However, a new OpenCart installation worked on that web server.
    Found the reason hours later: the Suhosin extension in PHP, which blocked part of the vqmod execution, was causing this. The error message was in the system error log, not in the web server's log.
    No idea why vqmod did not work with Suhosin. Disabling Suhosin for that virtual server solved it finally.

  13. I installed Opencart to a linux server couple of months ago. It was idle. Now I've started to put some products, installed a theme and SSL to do some tests. Everything was ok since two days before. The site suddenly gives plank page. Some of the error_log reads as follows: (H E L P !)

    [Fri Jul 04 06:43:41 2014] [error] [client 66.249.91.205] File does not exist: /vhosts/peraluna.com/http/feeds
    [Fri Jul 04 06:59:25 2014] [error] [client 66.249.78.137] File does not exist: /vhosts/peraluna.com/http/robots.txt
    [Fri Jul 04 07:43:51 2014] [error] [client 66.249.91.189] File does not exist: /vhosts/peraluna.com/http/feeds
    [Fri Jul 04 08:07:53 2014] [error] [client 207.46.13.120] File does not exist: /vhosts/peraluna.com/http/robots.txt
    [Fri Jul 04 08:44:01 2014] [error] [client 66.249.91.221] File does not exist: /vhosts/peraluna.com/http/feeds
    [Fri Jul 04 08:45:23 2014] [error] [client 78.186.59.72] File does not exist: /vhosts/peraluna.com/http/favicon.ico
    [Fri Jul 04 08:45:46 2014] [error] [client 78.186.59.72] File does not exist: /vhosts/peraluna.com/http/favicon.ico
    [Fri Jul 04 08:45:46 2014] [error] [client 78.186.59.72] File does not exist: /vhosts/peraluna.com/http/favicon.ico
    [Fri Jul 04 09:06:24 2014] [error] [client 193.107.17.99] File does not exist: /vhosts/peraluna.com/http/public_html.tar, referer: http://peraluna.com/
    [Fri Jul 04 09:44:11 2014] [error] [client 66.249.91.205] File does not exist: /vhosts/peraluna.com/http/feeds
    [Fri Jul 04 10:44:21 2014] [error] [client 66.249.91.189] File does not exist: /vhosts/peraluna.com/http/feeds
    [Fri Jul 04 10:44:38 2014] [error] [client 201.161.11.210] File does not exist: /vhosts/peraluna.com/http/admin/common
    [Fri Jul 04 11:12:13 2014] [error] [client 78.186.59.72] File does not exist: /vhosts/peraluna.com/http/favicon.ico
    [Fri Jul 04 11:12:13 2014] [error] [client 78.186.59.72] File does not exist: /vhosts/peraluna.com/http/favicon.ico
    [Fri Jul 04 11:40:58 2014] [error] [client 178.162.199.156] File does not exist: /vhosts/peraluna.com/http/favicon.ico
    [Fri Jul 04 11:44:31 2014] [error] [client 66.249.91.189] File does not exist: /vhosts/peraluna.com/http/feeds
    [Fri Jul 04 11:46:33 2014] [error] [client 46.165.210.38] File does not exist: /vhosts/peraluna.com/http/favicon.ico
    [Fri Jul 04 12:06:49 2014] [error] [client 66.249.78.159] File does not exist: /vhosts/peraluna.com/http/robots.txt
    [Fri Jul 04 12:06:49 2014] [error] [client 66.249.78.123] File does not exist: /vhosts/peraluna.com/http/robots.txt
    [Fri Jul 04 12:44:41 2014] [error] [client 66.249.91.189] File does not exist: /vhosts/peraluna.com/http/feeds

Trackbacks for this post

  1. How to Upgrade directly from 1.5.1 to 1.5.4.1 ? | Open Cart Know How

Leave a Reply