I have PHP installed as a CGI on my server. You can successfully place a php script in the cgi-bi and run it by putting
#!/usr/local/bin/php
at the top line of the script. It works from the command line and also through the web browser.
I am trying to get a Perl script to call the PHP script. The perl script looks like this:
#!/usr/bin/perl
print "Content-type: test/html\n\n";
system "myphpscript.php";
And myphpscript.php looks like this:
#!/usr/local/bin/php -q
echo "This is my php script!";
This perl scripts works just fine from the command line. It produces the correct output. However, when I run it from the web browser, the PHP output does not show at all.
This is strange since if I put in the perl script:
system "echo Here";
it DOES show. So for some reason it looks as though you cannot execute a PHP script from a Perl script through Apache.
Is this some configuration directive issue for Apache? What am I missing?