简体   繁体   English

将opencart从本地主机移至其他主机(Windows服务器)时,我的网站空白

[英]I am getting blank website while moving opencart from localhost to other host(windows server)

I am new to Opencart and have built an e-commerce website. 我是Opencart的新手,并建立了一个电子商务网站。 Everything was fine when I was running the site on localhost. 当我在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. 我已经更新了数据库,将其托管,并按照Internet上的说明进行了所有操作,但是我无法理解为什么页面空白。

Below I have shared my config.php file-: 下面我分享了我的config.php文件:

<?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. 或者,最好的方法,如果您有权访问php的错误日志文件,它将包含所有内容。

Never copy and paste like this on server for a CMS. 切勿在CMS的服务器上复制和粘贴此类内容。 just install a same version of opencart over the server first. 只需先在服务器上安装相同版本的opencart。

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 首次上传时,在启动Web应用程序之前,将这行放在主index.php(位于根目录中)中

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. 自2天以来,没有错误显示后端或前端正在挖掘。

After removing config.php and admin/config.php I found the actual error on installation page. 删除config.php和admin / config.php之后,我在安装页面上发现了实际错误。

Error was - 错误是-

  • php-zip extension missing php-zip扩展名丢失
  • php-mbstring extension missing php-mbstring扩展名丢失

Resolution was - 解决方案是-

I have installed both extensions php-zip & php-mbstring 我已经安装了两个扩展php-zipphp-mbstring

And reverted config.php as well as admin/config.php 并还原config.php以及admin / config.php

It worked for me :) 它为我工作:)

Most of the time it is because the version on php you use. 大多数时候是因为您使用的是php版本。 make sure your server's php version is higher than what your opencart version is required. 确保您服务器的php版本高于所需的opencart版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM