FAQ

php perl integration

Solo kihara
Sep 16, 2008 at 5:47 am
Hi,
My name is Solomon and I am having problems with php-perl integration. I saw
your article on http://www.justatheory.com/bricolage/1.9.0.html and I though
you might help.

I want to call a perl script from php and I am having a fatal error: "Fatal
error: Class 'Perl' not found ..."

I am using php 5.1.4 and Apache 2.0.59 on Win XP sp2. This WAMP server is
working perfectly ok. I have perl installed and working well as I can run
perl scripts. To do the php-perl integration I downloaded php_perl.dll from
http://pecl.net and placed it where other php extensions are located and
included the php_perl.dll extension in php.ini.

This is where the problem starts. When I try to restart the apache for the
settings to take effect, a fatal error appears: "'PHP Startup: Unable to
load dynamic library path.....' The specified procedure could not be found".
On running a simple script

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

Any help will be highly appreciated. Thank you in advance.


--
Solloh Kihara
Software Developer / Programmer
Tel: +254 726 567 797; +254 733 567 797
EMail: soloincc@gmail.com, soloincc@movert.co.ke
website: www.movert.co.ke
==============================
Najivunia Kuwa Mkenya
reply

Search Discussions

1 response

  • David E. Wheeler at Sep 16, 2008 at 4:49 pm

    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

Related Discussions

Discussion Navigation
viewthread | post

2 users in discussion

David E. Wheeler: 1 post Solo kihara: 1 post