perl 500内部服务器错误php包括

时间:2011-05-21 15:22:20

标签: php perl

我正在尝试使用PHP::Include在Perl中运行PHP文件,但浏览器获取500 Internal Server Error

这是我的代码:

#!/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";

2 个答案:

答案 0 :(得分:0)

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

php file.php

在该文件夹中,测试您正在使用的脚本

perl scriptname.pl

以便显示std错误(而不是通过CGI运行脚本时看到的通用500错误。)

答案 1 :(得分:0)

我注意到你在执行php include后打印标题(print "Content-type: text/html\n\n";)。根据php脚本中的实际内容,标头之前的任何非标头输出都会导致500错误。

相关问题