What is this? From this page you can use the Social Web links to save How I configured a custom PHP5 build on my Dreamhost account to a social bookmarking site, or the E-mail form to send a link via e-mail.

Social Web

E-mail

E-mail It
December 31, 2005

How I configured a custom PHP5 build on my Dreamhost account

Posted in: general

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:

  1. If you need unixODBC:
    1. Go here and download the newest version of the Debian binaries: unixODBC-x.x.x-x86-linux-deb.tar.gz
    2. to install: cd && tar xzf path/to/unixODBC-2.2.11.tar.gz
  2. If you need IMAP (much thanks to this guide in figuring this out):
    1. Go to ftp://ftp.cac.washington.edu/imap and download the latest IMAP. It will be named something like imap-2004g.tar.Z
    2. tar xzf imap-2004g.tar.Z
    3. cd imap-2004g
    4. make ldb SSLTYPE=none (say yes to the question it asks)
    5. mkdir lib
    6. mkdir include
    7. cd c-client
    8. cp *.h ../include/
    9. cp *.c ../lib/
    10. cp c-client.a ../lib/libc-client.a
  3. Download the latest php5 tarball from here
  4. 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'
  5. make install
  6. cp /etc/php5/cgi/php.ini /home/jjb/lib/
  7. edit /home/jjb/lib/php.ini and set include_path = ".:/usr/local/php5/lib/php:/home/jjb/lib/php" (so that php can find your local PEAR libraries)
  8. I then copied ~/bin/php into the the top of my web directory and named it php.cgi, as dreamhost recommends. You might want to put it into http://example.com/cgi-bin/ or anywhere else.
  9. I then added the following to my .htaccess file:
    AddHandler custom-php .php .pcgi

    Action custom-php /php.cgi

Return to: How I configured a custom PHP5 build on my Dreamhost account