in reply to Make PHP Execute in CGI output

Hey, I posted the "If you are not getting any returned values" post a while ago, I thought of more options:

You can use the exec() function, it is available in both Perl and PHP so you can crossexecute that way:
exec("c:/php/php.exe counter.php"); <? exec("c:/perl/perl.exe counter.pl"); ?>
You could probably use the LWP module in Perl and pull in the PHP page, although this would be kinda slow considering it is an extra HTTP call for each page.

Replies are listed 'Best First'.
Re: Re: Make PHP, yatta yatta....
by hakkr (Chaplain) on Dec 03, 2001 at 22:12 UTC
    I now have 2 installations of php, the server module one and a command line executable one installed to /usr/local/php/. I installed the command line one by leaving off the with-apache configure option.

    So I write my HTML to file then pass it to the PHP executable. Not very efficient but it works. Thank you all for putting me onto this method

    my $html =<<HTML; Content-type: text/html\n\n <?php include('header.php'); ?> <body> <!-- rest of doc --> </body> </html> HTML open PHP, '>phpinput.php'; print PHP $html; close PHP; #-q option to PHP forces it to leave off http headers my $output =eval {`/usr/local/php/bin/php -q phpinput.php`}; print $output unless $@;