PHP Perl Class
- October 20th, 2009
- By jrod
- Write comment
Hello,
I have a bit of problem combining PHP and Perl language.
I am trying to pass Perl variables into PHP and keep getting this error
“PHP Fatal error: Class ‘Perl’ not found in /var/www/html/hidden.php on line 3
”
find attached copy of my script.Regards,
Customer
Naturally, I thought the customer was crazy. Then I looked at the script:
$perl = new Perl();
$perl->require(“userexit.pl”);
I lol’ed and then search, it seems the Perl class is provided by the Zend people in the form of a php extension, which is, fortunately, in pecl.
Unfortunately, this package seems to be broken
( ~ ) pecl install perl
Package “perl” Version “1.0.0″ does not have REST xml available
install failed
I did some searching and found an ‘open’ bug report:
16807
Rather than did too deep, I decided to just install the module manually for the customer.
# wget http://pecl.php.net/get/perl-1.0.0.tgz
# tar xzfv perl-1.0.0.tgz
# cd perl-1.0.0
# phpize
# ./configure
# make
# make install
Now edit your php.ini to include:
extension=perl.so
Or on Red Hat/Fedora, simply:
echo “extension=perl.so” > /etc/php.d/perl.ini
Don’t forget to restart apache.
viola:
# php -v ; php -m | grep perl
PHP 5.1.6 (cli) (built: Feb 26 2009 07:01:12)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
perl
As always, be careful when installing unmanaged modules. Future updates to php may introduce instability when depending modules are not rebuilt with the new symbol table.
Happy Hacking.