0

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";
RobEarl
7,9226 gold badges38 silver badges52 bronze badges
asked May 21, 2011 at 15:22
2
  • 5
    Check your error log for a more detailed error message. Commented May 21, 2011 at 15:32
  • Check the server log for the error message. Commented May 21, 2011 at 17:09

2 Answers 2

0

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).

answered May 21, 2011 at 15:53
Sign up to request clarification or add additional context in comments.

Comments

0

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.

answered May 21, 2011 at 17:06

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.