{"id":683,"date":"2010-03-26T14:31:51","date_gmt":"2010-03-26T07:31:51","guid":{"rendered":"http:\/\/adityo.blog.binusian.org\/?p=683"},"modified":"2010-03-26T14:32:57","modified_gmt":"2010-03-26T07:32:57","slug":"how-to-integrate-perl-module-to-php-5-3-on-opensuse-10-2","status":"publish","type":"post","link":"https:\/\/adityo.blog.binusian.org\/?p=683","title":{"rendered":"How to integrate perl module to php 5.3 on opensuse 10.2"},"content":{"rendered":"<p>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.<\/p>\n<p>Installation<\/p>\n<p>download the php perl\u00a0 extention<\/p>\n<p># cd \/root<\/p>\n<p># wget <a href=\"http:\/\/pecl.php.net\/get\/perl-1.0.0.tgz\">http:\/\/pecl.php.net\/get\/perl-1.0.0.tgz<\/a><\/p>\n<p># tar -xvf <a href=\"http:\/\/pecl.php.net\/get\/perl-1.0.0.tgz\">perl-1.0.0.tgz<\/a><\/p>\n<p># cd perl-1.0.0<\/p>\n<p>you can read the README for detail installation on \/root\/perl-1.0.0<\/p>\n<pre>\r\n<pre>======================================================================================<\/pre>\n<p>Requirements<\/p>\n<p>============<\/p>\n<p>PHP 5.0.0RC2 or later<\/p>\n<p>Perl 5.8.0 or later<br \/>\nQuick install<\/p>\n<p>=============<br \/>\nStep 1. Compile this extension. PHP_PREFIX and PERL_PREFIX mast point to<\/p>\n<p>real<\/p>\n<p>PHP and Perl instalation prefixes.<br \/>\nexport PHP_PREFIX=\"\/usr\"<\/p>\n<p>export PERL_PREFIX=\"\/usr\"<\/p>\n<p>$PHP_PREFIX\/bin\/phpize<\/p>\n<p>.\/configure --with-perl=$PERL_PREFIX<\/p>\n<p>--with-php-config=$PHP_PREFIX\/bin\/php-config<\/p>\n<p>make<br \/>\nStep 2. Install the extension (this step can require root privileges)<br \/>\nmake install<br \/>\nStep 3. Add perl extension into your php.ini (this step can require root<\/p>\n<p>privileges)<br \/>\nextension=perl.so<\/p>\n<p>======================================================================================<br \/>\nI assume you have installed the php and perl, youc an use yast \/ zypper to do that<\/p>\n<p># php -v<br \/>\nPHP 5.3.1 (cli)<\/p>\n<p>#rpm -qa | grep perl<br \/>\nperl-5.10.0-72.5.i586<\/p>\n<p>you can search php\u00a0 prefix path by using whereis<\/p>\n<p># whereis php<br \/>\nphp: \/usr\/\/local\/bin\/php \/usr\/share\/man\/man1\/php.1.gz<\/p>\n<p># export PHP_PREFIX=&#8221;\/usr\/local&#8221;<br \/>\n# export PERL_PREFIX=&#8221;\/usr&#8221;<br \/>\n# $PHP_PREFIX\/bin\/phpize<br \/>\n# .\/configure &#8211;with-perl=$PERL_PREFIX<br \/>\n&#8211;with-php-config=$PHP_PREFIX\/bin\/php-config<br \/>\n# make<\/p>\n<p>you will find this error :<\/p>\n<p>\/root\/perl-1.0.0\/php_perl.c:172: warning: initialization from<br \/>\nincompatible pointer type<br \/>\n\/root\/perl-1.0.0\/php_perl.c:173: warning: initialization from<br \/>\nincompatible pointer type<br \/>\n\/root\/perl-1.0.0\/php_perl.c:199: warning: initialization from<br \/>\nincompatible pointer type<br \/>\n\/root\/perl-1.0.0\/php_perl.c:200: warning: initialization from<br \/>\nincompatible pointer type<br \/>\n\/root\/perl-1.0.0\/php_perl.c: In function \u00e2php_perl_zval_to_sv_ref\u00e2:<br \/>\n\/root\/perl-1.0.0\/php_perl.c:343: error: \u2018zval\u2019 has no member named \u2018is_ref\u2019<\/p>\n<p>\/root\/perl-1.0.0\/php_perl.c:1779: warning: assignment from incompatible<br \/>\npointer type<br \/>\nmake: *** [php_perl.lo] Error 1<\/p>\n<p>Solution :<\/p>\n<p>&#8211; it turns out the php_perl wasn&#8217;t compatible with the php 5.3<\/p>\n<p>&#8211;\u00a0 you need to go to http:\/\/svn.php.net\/viewvc\/pecl\/perl\/trunk\/ -&gt; click <a title=\"View file revision log\" name=\"php_perl.c\" href=\"http:\/\/svn.php.net\/viewvc\/pecl\/perl\/trunk\/php_perl.c?view=log\">php_perl.c<\/a> -&gt; then click download (http:\/\/svn.php.net\/viewvc\/pecl\/perl\/trunk\/php_perl.c?revision=289243&amp;view=co)<\/p>\n<p>&#8211; just wget http:\/\/svn.php.net\/viewvc\/pecl\/perl\/trunk\/php_perl.c?revision=289243&amp;view=co<\/p>\n<p>&#8211; 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<\/p>\n<p>#cd \/root\/perl-1.0.0<br \/>\n#\/usr\/local\/bin\/phpize<br \/>\n#.\/configure &#8211;with-perl=\/usr\/bin\/perl &#8211;with-php-config=\/usr\/local\/bin\/php-config<br \/>\n#make<br \/>\n#make install<\/p>\n<p>&#8211; Edit php.ini<br \/>\n#vim \/usr\/local\/lib\/php.ini<br \/>\n&#8211; add this line<\/p>\n<p>extension=perl.so<\/p>\n<p>&#8211; Restart the apache<br \/>\n#\/usr\/local\/apache2\/bin\/apachectl stop<br \/>\n#\/usr\/local\/apache2\/bin\/apachectl start<\/p>\n<p>&#8211; Check your phpinfo<br \/>\nhttp:\/localhost\/phpinfo.php<\/p>\n<p><a href=\"http:\/\/adityo.blog.binusian.org\/files\/2010\/03\/perl.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-684\" title=\"perl\" src=\"http:\/\/adityo.blog.binusian.org\/files\/2010\/03\/perl.png\" alt=\"perl\" width=\"628\" height=\"141\" srcset=\"https:\/\/adityo.blog.binusian.org\/files\/2010\/03\/perl.png 628w, https:\/\/adityo.blog.binusian.org\/files\/2010\/03\/perl-300x67.png 300w\" sizes=\"auto, (max-width: 628px) 100vw, 628px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":386,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2640,891],"tags":[6052],"class_list":["post-683","post","type-post","status-publish","format-standard","hentry","category-opensuse","category-php","tag-how-to-integrate-perl-module-to-php-5-3-on-opensuse-10-2"],"_links":{"self":[{"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/posts\/683","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/users\/386"}],"replies":[{"embeddable":true,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=683"}],"version-history":[{"count":5,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/posts\/683\/revisions"}],"predecessor-version":[{"id":716,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/posts\/683\/revisions\/716"}],"wp:attachment":[{"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=683"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=683"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=683"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}