PEAR installation


#1

I re-installed the PHP5 (default DH one doesn’t have iconv module) according to the wiki instruction. It works pretty well, now I just realized the installscript given by wiki has PEAR disabled (–withoutpear), i want to turn it on. So I change the installscript and restart the process. But pear still seems not enabled.

When i require_once (‘DB.php’), it complains Class ‘DB’ not found in /home/sxx/xxxx/xxx.php


#2

Don’t hold me to this since I never actually got it finished. I think I didn’t get XSL support in it to work. Anyways here is my modified ones. You will see some commented lines that used to be in there. The original version is meant to be built in your domain folder. This one is meant to be built in your home folder.

I should note a few things.

  • I’ve tested the permissions for the file you use on the web. It won’t allow direct access but it does all you to execute php scripts. (You only need user since suexec starts all interpreters as the user)
  • Some things were enabled or added in. Specifically support for fastcgi, ttf & freetype in gd module, pear, and pspell
  • This is a work in progress. I may try again but I did this mostly to use a newer php 5 module. I couldn’t get xsl support working but it is available in the system provided one.
  • Everything that is downloaded is installed to your home folder. Therefore if you don’t already have it you will likely see etc, share, lib, bin, and a few others that I can’t remember off the top of my head appear.

#—COPY ALL THIS—

CHANGE THIS TO YOUR DOMAIN NAME:

#export DOMAIN=YOURDOMAIN.COM

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
export PSPELL=aspell-0.60.4

#setup directories
cd ~
#cd $DOMAIN
#mkdir -p php
mkdir -p src/php
cd src/php
#get PHP and extract
wget http://us3.php.net/distributions/$PHP5.tar.gz
tar -xzf $PHP5.tar.gz
mkdir -p php5libs
cd php5libs
#get packages
wget http://ftp.gnu.org/pub/gnu/libiconv/$LIBICONF.tar.gz
wget http://easynews.dl.sourceforge.net/sourceforge/mcrypt/$LIBMCRYPT.tar.gz
wget http://xmlsoft.org/sources/$LIBXML2.tar.gz
wget http://xmlsoft.org/sources/$LIBXSLT.tar.gz
wget http://easynews.dl.sourceforge.net/sourceforge/mhash/$MHASH.tar.gz
wget http://www.zlib.net/$ZLIB.tar.gz
wget http://curl.haxx.se/download/$CURL.tar.gz
wget ftp://alpha.gnu.org/pub/gnu/libidn/$LIBIDN.tar.gz
wget ftp://ftp.cac.washington.edu/mail/$IMAP.tar.Z
wget ftp://ftp.gnu.org/gnu/aspell/$PSPELL.tar.gz
tar -xzf $LIBICONF.tar.gz
tar -xzf $LIBMCRYPT.tar.gz
tar -xzf $LIBXML2.tar.gz
tar -xzf $LIBXSLT.tar.gz
tar -xzf $MHASH.tar.gz
tar -xzf $ZLIB.tar.gz
tar -xzf $CURL.tar.gz
tar -xzf $LIBIDN.tar.gz
tar -xzf $IMAP.tar.Z
tar -xzf $PSPELL.tar.gz
#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
make
make install
#libxml2
cd …/$LIBXML2
./configure --with-iconv=$HOME --prefix=$HOME
make
make install
#libxslt
cd …/$LIBXSLT
./configure --prefix=$HOME --with-libxml-prefix=$HOME --with-libxml-include-prefix=$HOME/include/ --with-libxml-libs-prefix=$HOME/php/lib/
make
make install
#zlib
cd …/$ZLIB
./configure --shared --prefix=$HOME
make
make install
#libmcrypt
cd …/$LIBMCRYPT
./configure --disable-posix-threads --prefix=$HOME
make
make install
#libmcrypt lltdl issue!!
cd libltdl
./configure --prefix=$HOME --enable-ltdl-install
make
make install
#mhash
cd …/…/$MHASH
./configure --prefix=$HOME
make
make install
#libidn
cd …/$LIBIDN
./configure --with-iconv-prefix=$HOME --prefix=$HOME
make
make install
#cURL
cd …/$CURL
./configure --with-ssl=$HOME --with-zlib=$HOME --with-libidn=$HOME --enable-ipv6 --enable-cookies --enable-crypto-auth --prefix=$HOME
make
make install
#pspell
cd …/$PSPELL
./configure --prefix=$HOME
make
make install
#PHP 5
cd …/…/$PHP5
export PATH=$HOME/bin:$PATH
./configure
–prefix=$HOME
–enable-fastcgi
–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-config-file-path=$HOME/etc/php5
–with-xml
–with-libxml-dir=$HOME
–with-openssl=/usr
–with-mcrypt=$HOME
–with-mhash=$HOME
–with-zlib-dir=$HOME
–with-jpeg-dir=/usr
–with-png-dir=/usr
–with-gd
–with-ttf=/usr
–with-freetype-dir=/usr
–with-exif
–with-mysql=/usr
–with-mysqli
–with-gettext
–with-iconv=$HOME
–with-curl=$HOME
–with-imap=$HOME/src/php/php5libs/imap-2004g
–with-imap-ssl=/usr
–with-pspell=$HOME
make
make install
#copy config file
cd $HOME
mkdir -p etc/php5
cp $HOME/src/php/$PHP5/php.ini-dist $HOME/etc/php5/php.ini
#copy PHP CGI
#cd $HOME/
#mkdir -p cgi-bin
#cp $HOME/$DOMAIN/php/bin/php $HOME/$DOMAIN/cgi-bin/php.cgi
#chmod 755 cgi-bin
echo "Copy /bin/php to /cgi-bin/php.cgi"
echo "Chmod it 0100 (owner execute)"
echo ---------- INSTALL COMPLETE! ----------
#—STOP COPYING—