PHP - 简单的HTML DOM解析器 - 500服务器错误 [英] PHP - Simple HTML Dom parser - 500 Server Error

查看:262
本文介绍了PHP - 简单的HTML DOM解析器 - 500服务器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用PHP 5.2.10一个简单的CentOS 5.5服务器。我试图使用PHP简单的HTML DOM解析器但我得到一个500服务器错误。下面是脚本:

I'm running a simple CentOS 5.5 server with PHP 5.2.10. I'm trying to use PHP Simple HTML Dom parser but I get a 500 Server Error. Here is the script:

<?php
include_once('simple_html_dom.php');
$html = file_get_html('http://www.google.com/');

正如你所看到的,我还没有做的解析器做任何事,除了试图打开一个URL。和 file_get_html 是导致500服务器错误。

As you can see, I'm not even doing anything with the parser yet except trying to open a url. And that file_get_html is resulting in a 500 Server Error.

我看不出有任何错误显示httpd的错误日志了。所以,我不知道去哪里找找出问题。对于简单的HTML DOM解析器唯一的PHP的要求似乎是PHP 5+(检查)和PHP = allow_url_fopen选项在(检查)。

I don't see any errors showing up in the httpd error log. So I'm not sure where to look to figure out the problem. The only PHP requirements for Simple HTML Dom parser seem to be PHP 5+ (check) and php allow_url_fopen = On (check).

推荐答案

由于5.2版本,PHP将产生HTTP 500响应,如果有致命错误,并且display_errors设置是关闭的。打开在看到错误,停止脚本的执行。也许文件不包含(错误的权限,路径)和file_get_html()没有定义,或者file_get_html()产生一个致命的错误。

Since version 5.2, PHP will generate HTTP 500 response if there is fatal error, and display_errors is off. Turn in on to see the error, that stops the execution of the script. Maybe file is not included (wrong permissions, path) and file_get_html() is not defined, or maybe file_get_html() produces a fatal error.

这篇关于PHP - 简单的HTML DOM解析器 - 500服务器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆