December 18, 2009

Compiling php with xslt support

Inorder to manually compile php with xslt support, we need to manually install libxslt and libxml2
You need to install libxml2 before libxsl as it is a dependency for installing libxsl. You can download libxml from the following link. http://www.linuxfromscratch.org/blfs...l/libxml2.html
If you are having shell access do the following

wget http://ftp.gnome.org/pub/gnome/sourc...-2.6.26.tar.gz
untar the contents and inorder to compile and install libxml please perform the following steps

cd libxml-x.x.x

./configure --with-threads --with-tree --with-ftp --with-http --with-legacy --with-reader --with-writer --with-html --with-catalog --with-docbook --with-xpath --with-xptr --with-iconv

make
make install

This will install libxml on the server.

Now we need to install libxsl on the server.
You can download libxsl source from
http://www.linuxfromscratch.org/blfs...l/libxslt.html

wget http://ftp.gnome.org/pub/gnome/sourc...-1.1.17.tar.gz
tar -xvzf libxslt-1.1.17.tar.gz
cd libxslt-1.1.17
./configure --prefix=/usr
make
make install

Now what is remaining is to recompile php with xsl module enabled, the extra thing you need to add with your normal php recompilation for enabling xsl support is --with-xsl =/usr

Recompiling php
---------------

Download and untar php source from php.net

cd /path/php-x.x.x

I am giving a sample configuration below you can use it with needful editing

./configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --target=x86_64-redhat-linux-gnu --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info --cache-file=../config.cache --with-libdir=lib64 --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --disable-debug --with-pic --disable-rpath --without-pear --with-bz2 --with-curl --with-exec-dir=/usr/bin --with-freetype-dir=/usr --with-png-dir=/usr --enable-gd-native-ttf --without-gdbm --with-gettext --with-gmp --with-iconv --with-jpeg-dir=/usr --with-openssl --with-png --with-expat-dir=/usr --with-zlib --with-layout=GNU --enable-exif --enable-ftp --enable-magic-quotes --enable-sockets --enable-sysvsem --enable-sysvshm --enable-sysvmsg --enable-track-vars --enable-trans-sid --enable-yp --enable-wddx --with-kerberos --with-pcre-regex=/usr --enable-ucd-snmp-hack --with-unixODBC=shared,/usr --enable-memory-limit --enable-shmop --enable-calendar --enable-dbx --enable-dio --with-mime-magic=/etc/httpd/conf/magic --without-sqlite --with-libxml-dir=/usr --with-xml --with-apxs2=/usr/sbin/apxs --without-mysql --without-gd --without-odbc --disable-dom --disable-dba --without-unixODBC --disable-pdo --disable-xmlreader --disable-xmlwriter --enable-dom --with-xsl =/usr

make

make install

Now your php is compiled with xsl support. You can check whether it is compiled or not by using php -m command

No comments:

Post a Comment