我想在Perl运行PHP文件中使用PHP::Include
但浏览器中获取500 Internal Server Error
perl的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";
我想在Perl运行PHP文件中使用PHP::Include
但浏览器中获取500 Internal Server Error
perl的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";
测试你的file.php编译错误。
php file.php
,而该文件夹中,测试使用的是
perl scriptname.pl
所以才会被显示STD错误的脚本(而不是一般的500错误,通过CGI脚本运行时,你所看到的)。
没有造成错误 – Hemang 2011-05-21 16:17:09
我注意到你在做php include后打印了你的头文件(print "Content-type: text/html\n\n";
)。根据php脚本中的实际情况,头部之前的任何非头部输出都会导致500错误。
检查错误日志以获取更详细的错误消息。 – Maerlyn 2011-05-21 15:32:32
检查服务器日志以获取错误消息。 – Alex 2011-05-21 17:09:06