调试 Drupal 的白屏死机?
我有一个 Drupal 安装,以前在我的本地主机上运行得很好。但是,现在,格式化我的计算机后,它只显示空白屏幕(完全白色)。
所以我的问题是,如果我什至无法登录服务器,我如何才能看到问题出在哪里?
我能找到的唯一错误是(取自 Apache 错误日志):
[Tue May 17 05:05:04 2011] [notice] Parent: child process exited with status 255 -- Restarting.
[Tue May 17 05:05:04 2011] [notice] Digest: generating secret for digest authentication ...
[Tue May 17 05:05:04 2011] [notice] Digest: done
[Tue May 17 05:05:07 2011] [notice] Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i PHP/5.2.9 configured -- resuming normal operations
[Tue May 17 05:05:07 2011] [notice] Server built: Dec 10 2008 00:10:06
[Tue May 17 05:05:07 2011] [notice] Parent: Created child process 6992
Watchdog 中没有错误...
我正在使用 Xamp 1.7.1 (PHP 5.2) 和 Drupal 6。
我还需要提及的是,一旦我尝试并在我的本地计算机上加载该网站,apache 也崩溃了!我添加了这个:
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
它仍然只显示死亡屏幕?我在哪里可以真正看到错误?
我还在 apache access.log 中发现了这一点:
127.0.0.1 - - [17/May/2011:05:22:14 +0200] "GET /greekmerchant/src/ HTTP/1.1" 200 3
127.0.0.1 - - [17/May/2011:05:25:45 +0200] "GET /greekmerchant/src/update.php HTTP/1.1" 302 -
127.0.0.1 - - [17/May/2011:05:25:46 +0200] "GET /greekmerchant/src/update.php?op=info HTTP/1.1" 200 -
...在尝试访问 update.php 后。它也只是进入白屏。
我的 sql 配置文件中有这样的内容:
[mysqld]
port= 3306
socket= "C:/xampp/mysql/mysql.sock"
basedir="C:/xampp/mysql"
tmpdir="C:/xampp/tmp"
datadir="C:/xampp/mysql/data"
skip-locking
key_buffer = 16M
max_allowed_packet = 128M
table_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
log_error="mysql_error.log"
而且...
[mysqldump]
quick
max_allowed_packet = 128M
另外,我的 PHP 内存设置为 1024MB。
有人知道为什么这会死吗?真的是内存问题吗?我还能做什么才能显示错误?即使启用错误日志记录后我仍然看不到任何内容。
更新:
如果我删除文件夹,该网站将在我的本地计算机上运行。因此,由于某种原因,当它必须访问文件夹中的文件时,它会耗尽内存。为什么?或者更好的是,什么可能导致内存的过度使用?
I have a Drupal installation that previously worked perfectly on my localhost. However, now, after a formatted my computer, it just shows a blank screen (completely white).
So my question is, how can I see where things are going wrong, if I can't even log into the sever?
The only errors I can find are (taken from the Apache Error Logs):
[Tue May 17 05:05:04 2011] [notice] Parent: child process exited with status 255 -- Restarting.
[Tue May 17 05:05:04 2011] [notice] Digest: generating secret for digest authentication ...
[Tue May 17 05:05:04 2011] [notice] Digest: done
[Tue May 17 05:05:07 2011] [notice] Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i PHP/5.2.9 configured -- resuming normal operations
[Tue May 17 05:05:07 2011] [notice] Server built: Dec 10 2008 00:10:06
[Tue May 17 05:05:07 2011] [notice] Parent: Created child process 6992
There are no errors in Watchdog...
I am using Xamp 1.7.1 (PHP 5.2) and Drupal 6.
I just also need to mention that once I try and load the site on my local machine, apache also crashes! I added this:
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
And it still just shows the screen of death? Where can I actually see errors?
I also found this in apache access.log:
127.0.0.1 - - [17/May/2011:05:22:14 +0200] "GET /greekmerchant/src/ HTTP/1.1" 200 3
127.0.0.1 - - [17/May/2011:05:25:45 +0200] "GET /greekmerchant/src/update.php HTTP/1.1" 302 -
127.0.0.1 - - [17/May/2011:05:25:46 +0200] "GET /greekmerchant/src/update.php?op=info HTTP/1.1" 200 -
... after trying to access update.php. It also just goes to a white screen.
I have this in my sql config file:
[mysqld]
port= 3306
socket= "C:/xampp/mysql/mysql.sock"
basedir="C:/xampp/mysql"
tmpdir="C:/xampp/tmp"
datadir="C:/xampp/mysql/data"
skip-locking
key_buffer = 16M
max_allowed_packet = 128M
table_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
log_error="mysql_error.log"
And...
[mysqldump]
quick
max_allowed_packet = 128M
Also, my PHP memory is set to 1024MB.
Anyone got any idea why this is just dying? Is it really a memory problem? What else can I do to get errors shown to me? I still see nothing even after enabling error logging.
Update:
The website runs on my local machine if I delete the files folder. So, for some reason, when it has to access files in the files folder, it runs out of memory. Why? Or better yet, what could be causing this excessive use of memory?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
Drupal 手册中有整整一页专门用于调试“死机白屏”。简而言之,通过在 index.php 文件顶部添加以下内容来启用错误报告:
...并检查日志,您已经开始执行此操作。大多数时候,这两个步骤往往可以查明问题。如果这没有给您带来解决方案,请继续阅读手册页面,获取更多提示。
如果我不得不大胆猜测,我会说你的情况可能是内存不足错误。
There is a whole page in the Drupal handbooks dedicated to debugging the "White Screen of Death". In a nutshell, enable error reporting by adding the following at the top of your index.php file:
...and check the logs, which you've already started to do. Those two steps tend to pinpoint the problem, most of the time. If that doesn't point you towards a solution, continue down the handbook page, for lots more tips.
If I had to take a wild guess, I would say your case is probably an out-of-memory error.
我知道这可能已经晚了,但它对我有帮助。大多数情况下,模块会导致 WSOD,我无法仅禁用模块来测试它是什么,因为我可能在此过程中丢失了数据。我所做的是在 module.inc 中编辑这个函数
,并且我在上面的代码中添加了这 2 个打印语句,然后刷新页面,没有达到“完成加载 $module”语句的模块就是有问题的模块...这对我来说是发展。
找到模块后,您可以进入系统表并查找该模块,设置其状态 = 0 和 bootstrap = 0 或运行查询:
参考:调试 Drupal 白屏死机 (WSOD)
I know this may be late, but it helped me. Most times a module causes WSOD, I couldn't just disable modules to test which it was, since I may have lost data in the process. What I did was to edit this function in module.inc
And I added those 2 print statements in the code above, then refresh the page, the module which didn't reach the "Finish loading $module" statement is the one with the problem... it was devel in my case.
After finding the module, you can go into the system table and look for that module, set it's status = 0 and bootstrap = 0 or run the query:
Reference: Debugging Drupal White Screen of Death (WSOD)
检查 PHP 的错误报告设置。您可能需要启用错误报告。
这可能会有所帮助:http://drupal.org/node/158043
Check your error reporting settings for PHP. You may need to enable error reporting.
This may help: http://drupal.org/node/158043
theme('page') 渲染的内容是空的,这肯定会给你一个 WOD。
使用这个来帮助您,它可以找到一些与WOD相关的常见问题。
还可以尝试重建权限,最好的方法是使用 drush 并输入:
还可以使用 drush 查看当前安装的模块,
禁用所有自定义模块,然后进行搜索。
当你陷入困境时,清除缓存:
如果你认为 cron 是问题所在,我之前就遇到过写得不好的 cron 挂钩的巨大问题,以防万一这是你的问题,supercron 将成为您的朋友。
你应该有足够的内存,除非你有一些模块表现非常很糟糕。
* 更新疑难解答
如果在运行 update.php 时出现问题,请在文本编辑器中打开 update.php 并取消注释以下行:
请参阅 此页面 提供了许多其他 wsod 修复。值得注意的是,如果您使用 path-auto,该页面上提到的修复值得一看。
Content of theme('page') rendering is empty, and that would sure enough give you a WOD.
Use this to help you, it finds a couple of common issues related to WOD.
Also try rebuilding permissions, best way is to use drush and type:
Also use drush to view currently installed modules, with
disable ALL custom modules, and search.
And while you are in drush, clear the cache:
If you figure cron is the problem , I've had huge problems with badly written cron hooks before, just in case it is your issue, supercron will be your friend for this.
You should have enough memory unless you have some module in there behaving very badly.
* Troubleshooting update
If the problem occurs while running update.php open update.php in a text editor and uncomment the following line:
See this page for a bunch of other wsod fixes. Notably if you use path-auto, the fix mentionned on that page is worth a look into.
我的建议是获取模块和主题文件夹的全部内容并将其下载到桌面。这些主题和模块仍然安装,只是暂时禁用。如果您的网站恢复正常,则很可能是模块或主题错误。也许有人错过了结束括号“}”。如果您确定模块或主题不是问题,请将它们放回文件夹中,不会造成任何损失。尝试这个并没有什么坏处,因为你不会失去任何东西。如果您发现这是一个模块问题,请开始将它们一一放回文件夹中,一路刷新。一旦网站出现白屏,您就发现了问题,更新模块可能会有所帮助。
我总是先尝试这个,因为 drupal 安装非常稳定,你必须担心的是模块和主题。
与这里的其他答案不同,这不会准确指出问题,但如果您像我一样懒惰并且不想修改配置文件并打开错误,那么这就是要走的路,或者至少从这里开始然后去修改当其他一切都失败时进行配置。
My advice is to take the entire contents of your module and theme folder and download them to your desktop. These themes and modules are still installed just temporarily disabled. If your site comes back then it was most likely a module or theme error. Maybe someone missed a ending bracket '}'. If you are certain that the modules or themes are not the problem then place them back in the folder with no loss what so ever. It does not hurt to try this since you won't lose anything. If you find out it is a module problem start placing them one by one back in the folder refreshing along the way. Once the site white screens you found your problem and an update to a module might help.
I always try this first since the drupal install is pretty rock solid it is the modules and themes that you have to worry about.
Unlike the other answers here this wont exactly pin point the problem but if you are lazy like me and don't want to modify config files and turn on errors then this is the way to go, or at least start here then go and modify the configs when all else fails.
假设它是 Linux 主机,如果您的主机运行 suPHP 或某种其他形式的 suexec,则可能是权限问题。确保文件的所有权正确且访问模式正确。
您还可能有一个无效的 .htaccess 文件,请尝试将其删除以测试这一点。
Assuming it is a Linux host, it could be a permissions issue if your host is running suPHP or some other form of suexec. Make sure that the ownership of the files is correct and the access mode is correct.
You may also have an invalid .htaccess file, try to remove it just to test for this.
在我的
php.ini
中,我修改了这些变量:已执行:
消除我所有 Drupal 站点中的这些错误。
In my
php.ini
I modified these variables:Executed:
An get rid of these errors in all my Drupal sites.
有一个 WSOD,但它不会告诉我出了什么问题。启用
display_errors
/display_startup_errors
/error_reporting
后没有出现错误。 PHP 错误日志中没有任何内容。服务器错误日志中没有任何内容。只需一个 WSOD 即可计算。我最终设法让 Drupal 显示错误消息的方法是启用
$update_free_access = FALSE;
并导航到/update.php
。这表明没有待处理的更新,但在数据库中列出了一大堆错误,这是由于数据导入混乱造成的。Had a WSOD that just wouldn't tell me what was wrong. No errors showed up after enabling
display_errors
/display_startup_errors
/error_reporting
. There was nothing in the PHP error log. There was nothing in the server error log. Just a WSOD and go figure.The way I finally managed to coax Drupal into displaying error messages was to enable
$update_free_access = FALSE;
and navigate to/update.php
. This showed that there were no pending updates, but listed a whole bunch of errors in the database, which were the result of a messed up data import.检查主题目录(目录或文件)的内容。
在 marinelli 主题中,文件夹逻辑的缺失会导致此类问题。
Check the contents of the directory of your theme (directory or file).
In the
marinelli
theme the absence of folder logic causes this kind of problem.