Front page | perl.php.sandwich.dev |
Postings from September 2008
Re: php perl integration
Thread Previous
From:
David E. Wheeler
Date:
September 16, 2008 09:49
Subject:
Re: php perl integration
Message ID:
1B5452CA-4247-43CF-B589-C78DBC470618@kineticode.com
On Sep 15, 2008, at 22:47, solo kihara wrote:
> <?php
>
> print "Hello from PHP!\n";
> $perl = new Perl();
> $perl->require("script1.pl");
> print "Bye!\n";
>
> ?>
>
> it outputs the following:
>
> "Hello from PHP!
> *Fatal error*: Class 'Perl' not found in *C:\Documents and
> Settings\wwwroot\my scripts\perl.php* on line *5"*
>
> I have tried searching for solutions to this problem but to no avail.
You need to save that script to a file, and then use Perl and
PHP::Interpreter (assuming that you've installed the latter from CPAN)
to run it, like so:
perl -MPHP::Interpreter -e 'PHP::Interpreter->new->include(shift)'
myphp.php
HTH,
David
Thread Previous