Mailing List Archive

Status of PHP interpreter (Subject was: Input required: bricolagecms.org front page mock-up)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA224


On 16-Nov-09, at 11:21 AM, Waldo Jaquith wrote:

>> Is the php::Interpreter install still broken in v. 2.0?
>
> I certainly haven't yet gotten it to work, though not for lack of
> trying. (Writing these templates in Perl makes me want to hurl
> things at my monitor. Perl people, just imagine having to write your
> own in PHP. :) When we get PHP::Interpreter working, I very much
> look forward to contributing some templates to make it easy for my
> fellow PHP users to get started with writing templates.
>
> Last I recall, I'd hit that install problem <http://www.gossamer-threads.com/lists/bricolage/users/35065
> >, but found an entry on PerlMonks in which somebody was attempting
> to solve it <http://www.perlmonks.org/?node_id=685156>. David left a
> note there, encouraging the author to contribute his changes back to
> PHP::Interpreter. That was about a year ago. David, did anything
> ever come of that?


Just moving this conversation into it's own thread.

Would be great to find a maintainer the PHP functionality, as it does
seem to be something that people are looking for.

Phillip.

- --
Phillip Smith // Simplifier of Technology // COMMUNITY BANDWIDTH
www.communitybandwidth.ca // www.phillipadsmith.com







-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.12 (Darwin)

iFYEARELAAYFAksBgF4ACgkQUYvxXdY8XUlFBgDfRpBxIOd2UHS511mmHOy1Cdn8
MtlrcFk/GG+3uQDeIEB7oDqzHkkW8MVqkCivZ9NNm6U9kya1m3cE5A==
=QeXQ
-----END PGP SIGNATURE-----
Re: Status of PHP interpreter (Subject was: Input required: bricolagecms.org front page mock-up) [ In reply to ]
On Nov 16, 2009, at 8:39 AM, Phillip Smith wrote:

> Would be great to find a maintainer the PHP functionality, as it does seem to be something that people are looking for.

We'd need someone familiar with Perl and PHP internals and C. I can get them commit access.

Best,

David
Re: Status of PHP interpreter (Subject was: Input required: bricolagecms.org front page mock-up) [ In reply to ]
Hi,

On Mon Nov 16 09:05:22, David E. Wheeler wrote:

> On Nov 16, 2009, at 8:39 AM, Phillip Smith wrote:
>
> Would be great to find a maintainer the PHP functionality, as it does
> seem to be something that people are looking for.
>
> We'd need someone familiar with Perl and PHP internals and C. I can get
> them commit access.

Not sure I'd be up to being a maintainer. Sounds awful as you have to
deal with php4/php5, apache1/apache2, and then all the different distro
setups. =) That's a lot to check and test for.

If anyone else is interested, the problem we faced is that the module doesn't
detect the library paths and locations properly. On our servers, we
needed it to know where libphp5.so and libhttpd.so and also link against
libperl.so. Our patch looks like:

--- PHP-Interpreter-1.0.2.orig/Makefile.PL 2008-11-12 04:27:18.000000000 -0800
+++ PHP-Interpreter-1.0.2/Makefile.PL 2009-11-16 13:24:45.000000000 -0800
@@ -89,8 +89,12 @@
print "using lddlflags " . join(q{ }, @lddlflags) . "\n";

# Libs = lddlflags + php-version
-my @libs = ("$php_embedlib_path");
-push @libs, "-lphp$conf{version}";
+my @libs;
+if ($ENV{APACHE1_LIB_DIR}) {
+ push @libs, "-L$ENV{APACHE1_LIB_DIR}", "-lhttpd";
+}
+push @libs, $php_embedlib_path;
+push @libs, "-lphp$conf{version}", "-lperl";
print "using libs " . join(q{ }, @libs) . "\n";

my @ofiles = ('PHP.o', 'phpinterp.o', 'phpfuncs.o');

and then we just do:

APACHE1_LIB_DIR=/usr/lib/httpd perl Makefile.PL

and it passes all tests.

Your system also needs to be setup so libphp5, libperl, and libhttpd are
in the system ld.so.conf paths (often they aren't), which can make it
even more fun.

If anyone needs a hand getting it working or if anyone is interested in
maintaining and would like to bounce ideas, just let me know.

Cheers,

Alex

--
Alex Krohn <alex@gossamer-threads.com>
Gossamer Threads Inc. http://www.gossamer-threads.com/
Tel: (604) 687-5804 Fax: (604) 687-5806
Re: Status of PHP interpreter (Subject was: Input required: bricolagecms.org front page mock-up) [ In reply to ]
On Nov 17, 2009, at 6:48 AM, Alex Krohn wrote:

> Not sure I'd be up to being a maintainer. Sounds awful as you have to
> deal with php4/php5, apache1/apache2, and then all the different distro
> setups. =) That's a lot to check and test for.

IIRC, it's PHP5 only. And since the interpreter is embedded in Perl, you don't have to worry about Apache. But one might need to test different versions of Perl on different platforms.

> If anyone else is interested, the problem we faced is that the module doesn't
> detect the library paths and locations properly. On our servers, we
> needed it to know where libphp5.so and libhttpd.so and also link against
> libperl.so. Our patch looks like:
>
> --- PHP-Interpreter-1.0.2.orig/Makefile.PL 2008-11-12 04:27:18.000000000 -0800
> +++ PHP-Interpreter-1.0.2/Makefile.PL 2009-11-16 13:24:45.000000000 -0800
> @@ -89,8 +89,12 @@
> print "using lddlflags " . join(q{ }, @lddlflags) . "\n";
>
> # Libs = lddlflags + php-version
> -my @libs = ("$php_embedlib_path");
> -push @libs, "-lphp$conf{version}";
> +my @libs;
> +if ($ENV{APACHE1_LIB_DIR}) {
> + push @libs, "-L$ENV{APACHE1_LIB_DIR}", "-lhttpd";
> +}
> +push @libs, $php_embedlib_path;
> +push @libs, "-lphp$conf{version}", "-lperl";
> print "using libs " . join(q{ }, @libs) . "\n";
>
> my @ofiles = ('PHP.o', 'phpinterp.o', 'phpfuncs.o');
>
> and then we just do:
>
> APACHE1_LIB_DIR=/usr/lib/httpd perl Makefile.PL
>
> and it passes all tests.

There's got to be a reasonable way to do this in general with Perl modules that have external C library dependencies, no?

> Your system also needs to be setup so libphp5, libperl, and libhttpd are
> in the system ld.so.conf paths (often they aren't), which can make it
> even more fun.
>
> If anyone needs a hand getting it working or if anyone is interested in
> maintaining and would like to bounce ideas, just let me know.

Thanks for the offer, Alex. Now we just need someone to take it!

Best,

David