Drupal - 白屏死机 [英] Drupal - White Screen Of Death

查看:14
本文介绍了Drupal - 白屏死机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

刚刚用 drupal 更改了主题,我只剩下白屏死机.有效的默认主题是 Zen.这存储在 sites/mysite.com/themes 下我改成的主题我认为是themes/下的主题之一无权访问数据库.有 FTP 访问权限.有什么方法可以更改主题或安装一个有效的主题吗?

解决方案

纠正问题的最简单方法是找出问题所在.

转到 index.php 并在 <?php

后面添加以下几行

ini_set('display_errors',1);错误报告(E_ALL|E_STRICT);

然后在这里发布错误.完成后不要忘记评论/删除.

如果我理解正确,这就是你在去 WSOD 之前所做的.

  1. 您使用的是 Zen 主题.
  2. 您以管理员权限登录您的网站并访问了http://yoursite.com/admin莉>
  3. 您转到主题管理并将您的主题更改为另一个主题(以下简称theme_b")
  4. 刷新页面(或转到站点中的另一个页面)时,您会收到 WSOD.

.

如果这是真的,请按照以下步骤操作:

创建一个空白主题.为此,请在您的计算机中创建一个名为theme_b"的文件夹.

在里面创建以下文件:theme_b.info、template.php、style.css 和 page.tpl.php

打开 theme_b.info 并粘贴:

name = theme_b描述 = bla版本 = 1核心 = 6.x引擎 = phptemplate样式表[全部][] = style.css

保存.

打开 page.tpl.php 并粘贴:

<头><meta charset="utf-8"/><?php 打印 $head ?><title><?php print $head_title ?></title><?php 打印 $styles ?><?php 打印 $scripts ?><身体><div><?php print theme('links', $primary_links, array('class' => 'links primary-links')) ?></div><div><?php 打印主题('links', $secondary_links, array('class' => 'links secondary-links')) ?></div><div id="sidebar-left" class="sidebar"><?php print $left ?></div><div><?php if ($tabs): print '<div id="tabs-wrapper" class="clear-block">';万一;?><?php if ($title): 打印 '<h2'.($tabs ? ' class="with-tabs"' : '') .'>'.$title .'</h2>';万一;?><?php if ($tabs): 打印 '<ul class="tabs primary">'.$tabs .'</ul></div>';万一;?><?php if ($tabs2): 打印'<ul class="tabs secondary">'.$tabs2 .'</ul>';万一;?><?php if ($show_messages && $messages): 打印 $messages;万一;?><?php 打印 $help;?>

<div><?php 打印 $content;?>

保存.

然后将文件夹theme_a 上传到sites/yoursite.com/themes,替换现有的theme_a 文件夹.

这应该使您能够访问 drupal 的管理部分.

Just changed themes with drupal and I'm left with white screen of death. Default theme which worked was Zen. This is stored under sites/mysite.com/themes Theme I changed to I think is one of the themes under themes/ Don't have access to the database. Have FTP access. Is there any way to change themes or install one that will work?

解决方案

The easiest way to correct your problem is to find what's wrong.

go to index.php and add the following lines after <?php

ini_set('display_errors',1);
error_reporting(E_ALL|E_STRICT);

Then post the error here. Don't forget to comment/remove when you're done.

EDIT:

If I understood correctly this was what you did before going WSOD.

  1. You were using Zen theme.
  2. You logged into your site with administrator privileges and went to http://yoursite.com/admin
  3. You went to the theme management and changed your theme to another one (henceforth refered as "theme_b")
  4. When refreshed the page (or went to another page in your site) you got the WSOD.

.

If this is true then follow these steps:

Create a blank theme. In order to do this, create a folder in your computer named "theme_b".

Inside create the following files: theme_b.info, template.php, style.css and page.tpl.php

Open theme_b.info and paste this:

name = theme_b
description = bla
version = 1
core = 6.x
engine = phptemplate
stylesheets[all][] = style.css

Save.

Open page.tpl.php and paste this:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <?php print $head ?>
    <title><?php print $head_title ?></title>
    <?php print $styles ?>
    <?php print $scripts ?>
</head>
<body>
<div><?php print theme('links', $primary_links, array('class' => 'links primary-links')) ?></div>
<div><?php print theme('links', $secondary_links, array('class' => 'links secondary-links')) ?></div>
<div id="sidebar-left" class="sidebar"><?php print $left ?></div>
<div>
<?php if ($tabs): print '<div id="tabs-wrapper" class="clear-block">'; endif; ?>
<?php if ($title): print '<h2'. ($tabs ? ' class="with-tabs"' : '') .'>'. $title .'</h2>'; endif; ?>
<?php if ($tabs): print '<ul class="tabs primary">'. $tabs .'</ul></div>'; endif; ?>
<?php if ($tabs2): print '<ul class="tabs secondary">'. $tabs2 .'</ul>'; endif; ?>
<?php if ($show_messages && $messages): print $messages; endif; ?>
<?php print $help; ?>
</div>
<div>
<?php print $content; ?>
</div>
</body>
</html>

Save.

Then upload the folder theme_a to sites/yoursite.com/themes replacing existing theme_a folder.

This should enable you to access admin section of drupal.

这篇关于Drupal - 白屏死机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
其他开发最新文章
热门教程
热门工具
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆