Chinaunix首页 | 论坛 | 博客
  • 博客访问: 98774
  • 博文数量: 23
  • 博客积分: 1546
  • 博客等级: 上尉
  • 技术积分: 170
  • 用 户 组: 普通用户
  • 注册时间: 2007-11-18 19:47
文章分类

全部博文(23)

文章存档

2012年(1)

2011年(6)

2010年(3)

2009年(13)

我的朋友

分类: Python/Ruby

2012-06-18 23:42:37

PHP and perl are two very popular Web programming languages. They both have many libraries and extensions that can simplify the process of development, but often you can find a perl library you want, and not the corresponding library in PHP. (Perl is older then PHP, so naturally it has a larger selection of libraries and extensions.) This was the main reason that the perl extension for PHP was written.

Installation

download the php perl  extention

# cd /root

# wget 

# tar -xvf 

# cd perl-1.0.0

you can read the README for detail installation on /root/perl-1.0.0

======================================================================================

Requirements

============

PHP 5.0.0RC2 or later

Perl 5.8.0 or later
Quick install

=============
Step 1. Compile this extension. PHP_PREFIX and PERL_PREFIX mast point to

real

PHP and Perl instalation prefixes.
export PHP_PREFIX="/usr"

export PERL_PREFIX="/usr"

$PHP_PREFIX/bin/phpize

./configure --with-perl=$PERL_PREFIX

--with-php-config=$PHP_PREFIX/bin/php-config

make
Step 2. Install the extension (this step can require root privileges)
make install
Step 3. Add perl extension into your php.ini (this step can require root

privileges)
extension=perl.so

======================================================================================

I assume you have installed the php and perl, youc an use yast / zypper to do that

# php -v
PHP 5.3.1 (cli)

#rpm -qa | grep perl
perl-5.10.0-72.5.i586

you can search php  prefix path by using whereis

# whereis php
php: /usr//local/bin/php /usr/share/man/man1/php.1.gz

# export PHP_PREFIX=”/usr/local”
# export PERL_PREFIX=”/usr”
# $PHP_PREFIX/bin/phpize
# ./configure –with-perl=$PERL_PREFIX
–with-php-config=$PHP_PREFIX/bin/php-config
# make

you will find this error :

/root/perl-1.0.0/php_perl.c:172: warning: initialization from
incompatible pointer type
/root/perl-1.0.0/php_perl.c:173: warning: initialization from
incompatible pointer type
/root/perl-1.0.0/php_perl.c:199: warning: initialization from
incompatible pointer type
/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 aphp_perl_zval_to_sv_refa:
/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

Solution :

- it turns out the php_perl wasn’t compatible with the php 5.3

-  you need to go to -> click  -> then click download (php_perl.c?revision=289243&view=co)

- just wget php_perl.c?revision=289243&view=co

- you will get php_perl.c\?revision\=289243 just rename it to php_perl.c then paste it to /root/perl-1.0.0/ then

#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
#vim /usr/local/lib/php.ini
- add this line

extension=perl.so

阅读(2749) | 评论(0) | 转发(0) |
0

上一篇:为什么是hash表及如何选择hash函数?

下一篇:没有了

给主人留下些什么吧!~~