You are here: Re: [PHP] unable to load perl extension « PHP « IT news, forums, messages
Re: [PHP] unable to load perl extension

Posted by Jochem Maas on 12/29/05 17:45

dev lamp wrote:
> 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.

so the extension is not being loaded automatically right?
but if you dl() it everything is fine, right?
then double check the 'right' ini file is being used!

>
> 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)

personally I avoided this version of php like the plague - I would
suggest a diff. version just to rule out the possibility that 5.0.5
is the problem...

> 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


what is: --enable-maintainer-zts ?

have you tried stripping you configure line further to see if
that helps? i.e. remove everything apart from what you need to
run the specific code that relies on the perl extension. just to
see if removing something causes the perl extension to work

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

is the apache module using the php.ini that you think it is ?? -
that kind of thing has caught me out more than once!

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация