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";
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).
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.