Dreamhost allows its users to run their own custom builds of php 5. They outline the procedure here (only accessible by Dreamhost customers). Here are details on how I got my custom php5 build running on my account:
- If you need unixODBC:
- Go here and download the newest version of the Debian binaries: unixODBC-x.x.x-x86-linux-deb.tar.gz
- to install:
cd && tar xzf path/to/unixODBC-2.2.11.tar.gz
- If you need IMAP (much thanks to this guide in figuring this out):
- Go to ftp://ftp.cac.washington.edu/imap and download the latest IMAP. It will be named something like
imap-2004g.tar.Z tar xzf imap-2004g.tar.Zcd imap-2004gmake ldb SSLTYPE=none(say yes to the question it asks)mkdir libmkdir includecd c-clientcp *.h ../include/cp *.c ../lib/cp c-client.a ../lib/libc-client.a
- Go to ftp://ftp.cac.washington.edu/imap and download the latest IMAP. It will be named something like
- Download the latest php5 tarball from here
- Here is the command I used to configure php5. I started with the configuration used by dreamhost for their php5, which I found from phpinfo(). I then removed things I knew I wouldn’t need, and added a few things I did need:
'./configure' '--prefix=/home/jjb/' '--enable-fastcgi' '--with-mysql=/usr' '--enable-calendar' '--enable-force-cgi-redirect' '--enable-trans-sid' '--with-gd' '--with-xml' '--with-xsl' '--with-ttf=/usr' '--with-freetype-dir=/usr' '--enable-exif' '--with-xslt' '--with-xslt-sablot=/usr' '--with-dom-xslt=/usr' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-zlib-dir=/usr' '--enable-ftp' '--enable-mbstring' '--with-mysqli' '--with-gettext' '--with-unixODBC=/home/jjb/' '--with-imap=/home/jjb/src/imap-2004g' make installcp /etc/php5/cgi/php.ini /home/jjb/lib/- edit
/home/jjb/lib/php.iniand setinclude_path = ".:/usr/local/php5/lib/php:/home/jjb/lib/php"(so that php can find your local PEAR libraries) - I then copied
~/bin/phpinto the the top of my web directory and named itphp.cgi, as dreamhost recommends. You might want to put it into http://example.com/cgi-bin/ or anywhere else. - I then added the following to my
.htaccessfile:
AddHandler custom-php .php .pcgi
Action custom-php /php.cgi
0 Responses to “How I configured a custom PHP5 build on my Dreamhost account”
Leave a Reply