How To Compile PHP 5.3.x To Support Perl Extensions
What is PECL Perl ?
PECL Perl is extension embeds Perl Interpreter into PHP. It allows execute Perl files, evaluate Perl code, access Perl variables and instantiate Perl objects.
In this tutorial i will describe how to compile PECL perl with PHP 5.3.x
I found that latest pecl perl-1.0.0.tgz can't compile with PHP 5.3.x
If you trying to compile pecl perl with PHP 5.3.x it will shows error like below :
/root/perl-1.0.0/php_perl.c:200: warning: initialization from incompatible pointer type
/root/perl-1.0.0/php_perl.c: In function âphp_perl_zval_to_sv_refâ:
/root/perl-1.0.0/php_perl.c:343: error: ‘zval’ has no member named ‘is_ref’
/root/perl-1.0.0/php_perl.c:1779: warning: assignment from incompatible pointer type
make: *** [php_perl.lo] Error 1
So after googling i found that pecl perl svn already have a patch there.
below are the steps how to patch and compile pecl perl with PHP 5.3.x
Download and Extract PECL Perl Package
#cd /root/
#wget http://pecl.php.net/get/perl-1.0.0.tgz
#tar -zxvf perl-1.0.0.tgz
#cd perl-1.0.0
Download php_perl.c from SVN pecl perl and replace with the old one
you can download it using svn from this url http://svn.php.net/viewvc/pecl/perl/trunk/
but the strange thing is i can't download php_perl.c with svn and i don't know why
but finally i download it manually to my client and uploaded to /root/perl-1.0.0
if the ftp client ask to replace php_perl.c just press OK to replace the old php_perl.c file
Configure and Compiling Pecl Perl
#cd /root/perl-1.0.0
#/usr/local/bin/phpize
#./configure --with-perl=/usr/bin/perl --with-php-config=/usr/local/bin/php-config
#make
#make install
Edit php.ini
#pico /usr/local/lib/php.ini
### add perl.so in extension section ####
extension=perl.so
Restarting apache
#/usr/local/apache2/bin/apachectl stop
#/usr/local/apache2/bin/apachectl start
See the result with phpinfo
#cd /usr/local/apache2/htdocs
#pico phpinfo.php
<? phpinfo(); ?>
Open a Web Browser
http://<youripaddress>/phpinfo.php
You should see a perl extensions loaded in your phpinfo page
Recent blog posts |
Recent comments
|
Comments
Where is new php_perl.c
I don't know where to download php-perl.c when svn doesn't work.
please tell me how to download it.
try go search in svn
first, try to googling first,
second, try to search directly into svn network
Windows extension
I would gladly pay a small amount to anyone that can compile and build a working windows extension of PECL Perl, aka php_perl.dll for PHP 5.3.x !!
hi tobias, you can email me
hi tobias, you can email me at chai@wowtutorial.org
i can help you out free of charge :)
Post new comment