in reply to use PHP::Interpreter throws undefined symbol: zend_ce_traversable

Note (probably harmless): No library found for -lphp5
This is not harmless, in fact, PHP::Interpreter won't work unless the php library (i.e. /usr/local/lib/libphp5.so on Linux) is found. I think part of the problem is that the stock php is not configure'd with the --enable-embed option:
./configure --enable-embed
Download the php sources, compile and install. php will by default install itself into /usr/local on a Linux system, and the stock Makefile.PL assumes both the php header files and the php libraries can be found there.

The README contains build instructions (which BTW works with php 5.2.x also):

1) Download the PHP sources from php.net 2) tar zxf php-5.1.x.tar.gz 3) cd php-5.1.x 4) ./configure --enable-embed [any other options you want] 5) make 6) make install 7) install PHP::Interpreter
Checkpoints:
--
No matter how great and destructive your problems may seem now, remember, you've probably only seen the tip of them. [1]

Replies are listed 'Best First'.
Re^2: use PHP::Interpreter throws undefined symbol: zend_ce_traversable
by Anonymous Monk on Dec 02, 2008 at 21:02 UTC
    yum provides /usr/lib/libphp5.so and voilá : we need php-embedded-5.2.6-5.i386
      Yes, the lucky guys who have yum available just type

      yum install php-embedded

      Although you get the /usr/lib/libphp5.so immediately with this way, I ran into the problem there was another symbol missing for "dbase".

      So I compiled the latest version of PHP as suggested above on my notebook with additionally

      ./configure --enable-embed --enable-dbase

      Then, all you need to copy to another machine is the fresh created libphp5.so into /usr/lib. This binary was fully portable. compiled on Fedora 9, ran perfect on Fedora 5 as well.

      This shit runs amazingly fast. I'm using this wrapper for creating nice-looking PDFs with PHP's fpdf. Didn't see an easy-to-use PDF interface for Perl so far.

      So to conclude this second recipe and maybe increase the Google ranking for people who're seeking such answers here's the complete procedure that worked on 3 servers:

      1.) yum install php-devel

      2.) Download and compile the latest release of PHP from php.net
      	./configure --enable-embed --enable-dbase
      	make
      	make test
      	su -
      	make install
      
      You may compile this bundle on your Notebook for example (Guess we're talking about Linux on all systems ;). All you'll need later is the file "libphp5.so". So for future distributing the functionality of PHP::Interpreter you could omit this point.

      3.) Then, cd /usr/lib --> copy "libphp5.so" here.

      4.) force install PHP::Interpreter

      Have fun!
      --reto