Drupal_网站迁移后的配置

网站往服务器迁移后遇到了一些问题,这里汇总一下:



1,无响应无提示,返回空白页面

2,有内容,但是错乱,有很多丢失,而且没有CSS样式

3,PDO错误(你肯定忘了在settings.php里面配置Mysql密码了把)

4,图片都显示不了


1,环境是 nginx服务器 经过几番查找,

可以在首页加入 error_reporting(E_ALL);

发现问题的原因是:cache memory 不够,导致 expired了

解决办法:配置php5-fpm ,将默认的 32M 改为 64M

(Drupal的缓存机制所致,以后的话可能还不够;其实在安装Drupal的过程中,有提示的让调高,我当时没做)


2,有内容,我们就去看看Source Code


@import url("/drupal_fllcc/sites/all/themes/fllcc_zen/css/blocks.css?mjwbae");
@import url("/drupal_fllcc/sites/all/themes/fllcc_zen/css/navigation.css?mjwbae");
@import url("/drupal_fllcc/sites/all/themes/fllcc_zen/css/views-styles.css?mjwbae");
@import url("/drupal_fllcc/sites/all/themes/fllcc_zen/css/nodes.css?mjwbae");
@import url("/drupal_fllcc/sites/all/themes/fllcc_zen/css/comments.css?mjwbae");
@import url("/drupal_fllcc/sites/all/themes/fllcc_zen/css/forms.css?mjwbae"

原来是我们的路径都定义的  /drupal_fllcc/sites

而我们把网站的域名绑到了 /sites  那一级了

解决这个问题很简单

找到  /drupal/sites/all/default/settings.php


(对了,当时要修改Mysql链接密码的话也是在这个文件里面

$databases = array (
  'default' => 
  array (
    'default' => 
    array (
      'database' => 'drupal_fllcc',
      'username' => 'root',
      'password' => '123456',
      'host' => 'localhost',
      'port' => '',
      'driver' => 'mysql',
      'prefix' => '',
    ),
  ),
);

言归正转……

/**
 * Base URL (optional).
 *
 * If Drupal is generating incorrect URLs on your site, which could
 * be in HTML headers (links to CSS and JS files) or visible links on pages
 * (such as in menus), uncomment the Base URL statement below (remove the
 * leading hash sign) and fill in the absolute URL to your Drupal installation.
 *
 * You might also want to force users to use a given domain.
 * See the .htaccess file for more information.
 *
 * Examples:
 *   $base_url = 'http://www.example.com';
 *   $base_url = 'http://www.example.com:8888';
 *   $base_url = 'http://www.example.com/drupal';
 *   $base_url = 'https://www.example.com:8888/drupal';
 *
 * It is not allowed to have a trailing slash; Drupal will add it
 * for you.
 */
//$base_url = 'http://localhost/drupal_fllcc';
 $base_url = '';

记得不能在URL的最后加 /


Drupal will add it for you.

4,图片都显示不了

这个是因为 【图片路径】=【当前你的根路径】+【图片的相对路径】

而你的根路径在 settings.php中修改了,因此图片路径也就错乱,当然找不到了

解决办法,一个个修改【图片的相对路径】




  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值