2011-05-21 60 views
0

我想在Perl运行PHP文件中使用PHP::Include但浏览器中获取500 Internal Server Errorperl的500内部服务器错误PHP的包括:

这里是我的代码:

#!/usr/local/bin/perl 

use PHP::Include; 
include_php_vars('file.php'); 
print "Content-type: text/html\n\n"; 
print "<H1>Hello World</H1>\n"; 
+5

检查错误日志以获取更详细的错误消息。 – Maerlyn 2011-05-21 15:32:32

+0

检查服务器日志以获取错误消息。 – Alex 2011-05-21 17:09:06

回答

0

测试你的file.php编译错误。

php file.php 

,而该文件夹中,测试使用的是

perl scriptname.pl 

所以才会被显示STD错误的脚本(而不是一般的500错误,通过CGI脚本运行时,你所看到的)。

+0

没有造成错误 – Hemang 2011-05-21 16:17:09

0

我注意到你在做php include后打印了你的头文件(print "Content-type: text/html\n\n";)。根据php脚本中的实际情况,头部之前的任何非头部输出都会导致500错误。