I am trying to run PHP file in Perl using PHP::Include but browser getting 500 Internal Server Error
Here is my code:
#!/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";
-
5Check your error log for a more detailed error message.Maerlyn– Maerlyn2011年05月21日 15:32:32 +00:00Commented May 21, 2011 at 15:32
-
Check the server log for the error message.Alex– Alex2011年05月21日 17:09:06 +00:00Commented May 21, 2011 at 17:09
2 Answers 2
test your file.php for compilation errors.
php file.php
while in that folder, test the script you are using
perl scriptname.pl
so that std error will be displayed (instead of the generic 500 error you are seeing when running the script through CGI).
Comments
I notice that you are printing your header (print "Content-type: text/html\n\n";) after doing the php include. Depending on what is actually in your php script, any non-header output before the header would result in a 500 error.