I am new to Opencart and have built an e-commerce website. Everything was fine when I was running the site on localhost. But when I hosted everything on the client's server, the displayed page is entirely blank and it is not even giving errors. I have already updated database, hosted it and did everything according to the instructions on the Internet but I am not able to understand why the page is blank.
Below I have shared my config.php file-:
<?php
// HTTP
define('HTTP_SERVER', 'http://www.my_domain.in/');
define('HTTP_ADMIN', 'http://www.my_domain.in/wwwroot/admin/');
define('HTTP_IMAGE', 'http://www.my_domain.in/wwwroot/image/');
// HTTPS
define('HTTPS_SERVER', 'http://www.my_domain.in/');
define('HTTPS_ADMIN', 'http://www.my_domain.in/wwwroot/admin/');
define('HTTPS_IMAGE', 'http://www.my_domain.in/wwwroot/image/');
// DIR
define('DIR_APPLICATION', '/home/my_domain.in/wwwroot/catalog/');
define('DIR_SYSTEM', '/home/my_domain.in/wwwroot/system/');
define('DIR_DATABASE', '/home/my_domain.in/wwwroot/system/database/');
define('DIR_LANGUAGE', '/home/my_domain.in/wwwroot/catalog/language/');
define('DIR_TEMPLATE', '/home/my_domain.in/wwwroot/catalog/view/theme/');
define('DIR_CONFIG', '/home/my_domain.in/wwwroot/system/config/');
define('DIR_IMAGE', '/home/my_domain.in/wwwroot/image/');
define('DIR_CACHE', '/home/my_domain.in/wwwroot/system/cache/');
define('DIR_DOWNLOAD', '/home/my_domain.in/wwwroot/download/');
define('DIR_LOGS', '/home/my_domain.in/wwwroot/system/logs/');
// DB
define('DB_DRIVER', 'mysql');
define('DB_HOSTNAME', 'localhost');
define('DB_USERNAME', 'buds');
define('DB_PASSWORD', 'buds@1234');
define('DB_DATABASE', 'buds');
define('DB_PREFIX', 'oc_');
?>
This is directory structure where I have uploaded all my files-:
home/host/wwwroot
Please write following code on the top:
<?php ini_set('display_errors', 'on'); ?>
You will get exactly what is causing the blank screen. OR, Best way, If you have access to php's error log file, it will have everything in it.
Never copy and paste like this on server for a CMS. just install a same version of opencart over the server first.
After that replace the database from your.
After that upload all your files and directories on server except config file. remember there are two config files for open cart, one for admin and one for front.
First time while uploading, in your main index.php (located in root directory) put this line somewhere before starting web application
ini_set('display_errors', 'on');
but don't forget to comment this line after successfully run of website.
I was having same issue. There is none error showing at backend or frontend was digging since 2 days.
After removing config.php and admin/config.php I found the actual error on installation page.
Error was -
Resolution was -
I have installed both extensions php-zip & php-mbstring
And reverted config.php as well as admin/config.php
It worked for me :)
Most of the time it is because the version on php you use. make sure your server's php version is higher than what your opencart version is required.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.