Compiling php5

I am trying to do a custom compile of php5 but I’m running into problems:

/home/adrosenth/php5/lib/ undefined reference to xmlModuleClose' /home/adrosenth/php5/lib/ undefined reference toxmlModuleOpen’
/home/adrosenth/php5/lib/ undefined reference to xmlModuleSymbol' collect2: ld returned 1 exit status make: *** [sapi/cgi/php] Error 1 cp: cannot stat/home/adrosenth/php5/bin/php’: No such file or directory

Here is my install script:


Change this to the PHP Version of your choice

export PHP5=php-5.1.2

Change this to the last working Libs (may be you have to try and error)

export LIBICONF=libiconv-1.10
export LIBMCRYPT=libmcrypt-2.5.7
export LIBXML2=libxml2-2.6.23
export LIBXSLT=libxslt-1.1.15
export MHASH=mhash-0.9.2
export ZLIB=zlib-1.2.3
export CURL=curl-7.15.1
export LIBIDN=libidn-0.6.1
export IMAP=imap-2004g

#setup directories
cd ~
mkdir -p php5
cd src/php5/php5libs
#get packages
cd $IMAP
sed -e “s/SSLDIR=/usr/local/ssl/SSLDIR=/usr/g” <src/osdep/unix/Makefile >src/osdep/unix/111
rm -rf src/osdep/unix/Makefile
mv src/osdep/unix/111 src/osdep/unix/Makefile
make slx
./configure --enable-extra-encodings --prefix=$HOME/php5
make install
cd …/$LIBXML2
./configure --with-iconv=$HOME/php5 --prefix=$HOME/php5
make install
./configure --prefix=$HOME/php5 --with-libxml-prefix=$HOME/php5 --with-libxml-include-prefix=$HOME/php5/include/ --with-libxml-libs-prefix=$HOME/php5/lib/
make install
cd …/$ZLIB
./configure --shared --prefix=$HOME/php5
make install
./configure --disable-posix-threads --prefix=$HOME/php5
make install
#libmcrypt lltdl issue!!
cd libltdl
./configure --prefix=$HOME/php5 --enable-ltdl-install
make install
cd …/…/$MHASH
./configure --prefix=$HOME/php5
make install
cd …/$LIBIDN
./configure --with-iconv-prefix=$HOME/php5 --prefix=$HOME/php5
make install
cd …/$CURL
./configure --with-ssl=$HOME/php5 --with-zlib=$HOME/php5 --with-libidn=$HOME/php5 --enable-ipv6 --enable-cookies --enable-crypto-auth --prefix=$HOME/php5
make install
#PHP 5
cd …/…/$PHP5
make install
#copy config file
cd $HOME
mkdir -p etc/php5
cp $HOME/src/php5/$PHP5/php.ini-dist $HOME/etc/php5/php.ini
#copy PHP CGI
cd $HOME/
mkdir -p cgi-bin
cp $HOME/php5/bin/php $HOME/cgi-bin/php.cgi
chmod 755 cgi-bin

Remove "–with-xsl=$HOME/php5 "

I’m having the same problem, too. I think it’s a PHP5 error, but their bug report is saying it’s a server configuration error.

What ever it is, I just can’t get PHP5 to compile with XSL unfortunately.

seeing as I’ve never installed php my self, I could be wrong… But can you complie xsl after php it self has been installed? It seems that the error message above is referencing php, and that’s not actually installed untill the end of the script.

If that doesn’t work, or if you have to compile xsl first so php will automatically discover it on compile, does creating the directories it’s asking for help out at all?


Nah, I’m pretty sure you compile XSLT before you compile PHP, because PHP needs the compiled XSLT libraries (thus the --with-xsl=$HOME/php5 : I compiled all the libraries to that directory). XSLT compiles fine, it’s just the error in the make process for PHP.

The directory error you see at the end doesn’t have to do with anything. That’s stuff I have going on AFTER PHP is compiled.

/nod, you compile XSLT before hand.

The stat error is irrelevant. The odd part is that XSLT compiles just fine. This error is generated when it’s compiling the actual CLI binary. Everything else works, but the binary itself. Really odd. I’ve been unable to fix it myself.

You know what’s funny? Take a look at this:

That’s the phpinfo output for a dreamhost site. Now, look at their config: they compiled with xsl!

Now, there are two reasons (as far as I can see) they could have been able to do this:

  1. different server than I’m on
  2. older version of PHP5 than I’m compiling

It’s cause it’s an older version. I’ve already investigated that part. :wink:

The bug I posted in the thread I created a few days ago here on the DH forums shows that the person started having problems with 5.1.1. So my guess is it’s a 5.1 change that caused some problems.