Re: php perl integration
[email protected] ("David E. Wheeler") Tue, 16 Sep 2008 09:49:43 -0700
| Newsgroups | perl.php.sandwich.dev |
|---|---|
| Message-ID | <[email protected]> |
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