Compiling php5


#1

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

/home/adrosenth/php5/lib/libxslt.so: undefined reference to xmlModuleClose' /home/adrosenth/php5/lib/libxslt.so: undefined reference toxmlModuleOpen’
/home/adrosenth/php5/lib/libxslt.so: 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:

#—COPY ALL THIS—

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
#imap
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
#libiconv
cd …/$LIBICONF
./configure --enable-extra-encodings --prefix=$HOME/php5
make
make install
#libxml2
cd …/$LIBXML2
./configure --with-iconv=$HOME/php5 --prefix=$HOME/php5
make
make install
#libxslt
cd …/$LIBXSLT
./configure --prefix=$HOME/php5 --with-libxml-prefix=$HOME/php5 --with-libxml-include-prefix=$HOME/php5/include/ --with-libxml-libs-prefix=$HOME/php5/lib/
make
make install
#zlib
cd …/$ZLIB
./configure --shared --prefix=$HOME/php5
make
make install
#libmcrypt
cd …/$LIBMCRYPT
./configure --disable-posix-threads --prefix=$HOME/php5
make
make install
#libmcrypt lltdl issue!!
cd libltdl
./configure --prefix=$HOME/php5 --enable-ltdl-install
make
make install
#mhash
cd …/…/$MHASH
./configure --prefix=$HOME/php5
make
make install
#libidn
cd …/$LIBIDN
./configure --with-iconv-prefix=$HOME/php5 --prefix=$HOME/php5
make
make install
#cURL
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
make install
#PHP 5
cd …/…/$PHP5
./configure
–prefix=$HOME/php5
–with-libxml-dir=$HOME/php5
–with-mcrypt=$HOME/php5
–with-mhash=$HOME/php5
–with-curl=$HOME/php5
–with-curl-wrappers
–with-xsl=$HOME/php5
–with-iconv=$HOME/php5
–with-zlib-dir=$HOME/php5
–with-config-file-path=$HOME/etc/php5
–enable-force-cgi-redirect
–enable-gd-native-ttf
–enable-ftp
–enable-sockets
–enable-wddx
–enable-sqlite-utf8
–enable-calendar
–enable-mbstring
–enable-mbregex
–enable-soap
–with-xml
–with-openssl=/usr
–with-jpeg-dir=/usr
–with-png-dir=/usr
–with-gd
–with-jpeg
–with-png
–with-gif
–with-tiff
–with-ttf
–with-freetype
–with-gettext
–enable-gd-native-ttf
–enable-exif
–with-exif
–with-mysql=/usr
–with-mysqli
–without-pear
make
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


#2

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.


#3

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?

-Matttail


#4

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.


#5

/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.


#6

You know what’s funny? Take a look at this: http://php.dreamhosters.com/php5-custom-cgi/

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

#7

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.