Original Content
 ,  

Using Perl Code from PHP

Intended Audience
Introduction
Perl Interpreter in PHP
Using Perl Objects
Error Handling
Summary

Published: April 14th, 2004 at 12:00
Categories: Uncategorized
Tags: ,

8 comments to “Using Perl Code from PHP”

This PECL extension seems really cool, but its for PHP5 only. How can I do this php->perl stuff in php4?

_____anonymous_____
July 4th, 2007 at 5:21 pm

You upgrade to php5. Its been out for 4 years, its time for an upgrade.

I installed PHP’s perl extension on debian. Everything installed without any errors. I checked whether PERL is properly installed by doing ‘apt-get install perl’. To be completely sure, I copied the perl.so file in the usr/lib/php5 directory. When I try to use the extension within a php script ($perl = new Perl();),I get a php error that the class cannot be found. Any ideas?

_____anonymous_____
April 22nd, 2008 at 2:48 pm

add
extention=perl.so to your php.ini file

_____anonymous_____
June 2nd, 2008 at 2:01 pm

$perl = New Perl() points to /usr/bin/perl or what default perl is.
What if I want to use /usr/local/bin/perl?

Do I have to decide this at pecl compile time?

I`m trying to pass variable from PHP file to perl script in code bellow. If someone has an example to post that would be great, btw. everything else works great.

_____anonymous_____
May 18th, 2009 at 10:36 pm

Hello,
I notice that doing a $perl->require() or $perl->eval(), will send the header even if using output buffering. Once that happens, I can no longer set cookies, etc. Has anyone been able to use perl without it sending a header?

Thanks!