how to call perl code from PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

I am unable to call perl code from PHP, since the extension does not
get loaded !

Scenario 1:
use dl('perl.so'); in the php code and invoke the script from the command line
The script works fine and the perl code gets executed as well.

Scenario 2:
the perl extension does not get loaded and the PHP script crashes.

I have read the article
http://www.zend.com/php5/articles/php5-perl.php

If anybody has faced this issue, please share how you solved the problem ?

Thanks in advance.
----
Here are the environment Details:
RHEL 4.0
PHP 5.0.5 (self compiled)
PECL/PERL package checked out from CVS

PHP 5.0.5 compilation details
---------------------------
./configure  --with-apxs2=/usr/local/apache2/bin/apxs 
--with-mysql=/usr/bin/mysql_config 
--with-mysqli=/usr/bin/mysql_config --with-openssl-dir=/usr/local/ssl
--with-libxml-dir=/usr/lib --enable-soap --enable-sockets
--enable-sqlite-utf8  --enable-wddx --with-gnu-ld  --with-gd
--with-jpeg-dir=/usr/local/lib --with-png-dir=/usr/local/lib
--with-zlib-dir=/usr/local/lib --with-gd=/usr/local 
--enable-gd-native-ttf --enable-maintainer-zts  --with-pear
make
make install


pecl/perl package compilation details
-------------------------
export PHP_PREFIX="/usr/local"
export PERL_PREFIX="/usr"
echo $PHP_PREFIX
echo $PERL_PREFIX
$PHP_PREFIX/bin/phpize
./configure --with-perl=$PERL_PREFIX
--with-php-config=$PHP_PREFIX/bin/php-config
make
make install

entries in php.ini file
--------------

extension_dir = "/usr/local/lib/php/extensions/no-debug-zts-20041030/"
extension=perl.so


sample test code is as follows -
<?php
if (!extension_loaded('perl'))
{
    print "perl extension not loaded";
    exit;
}
?>

--
Dev.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux