PiNG's guide to custom compiling PHP on DreamHost.
Guide for users who wish to have everything needed compiled including IMAP support in PHP!
Thanks to pointers from: Kelley's Page and some pointers from rhinosw's post.

I used the latest versions of libraries as of 8/12/2005

The "$" sign indicates an actual command line syntax. Don't use the "$" sign!

Replace everything in RED with YOUR OWN PATH!!!!!!!!
ping = your user name inside /home/ | ffxionline.com = your html root directory
FOR BEST RESULT AND NO CONFUSION DO STEP BY STEP EVEN THOUGH IT MAY TAKE YOU LONG TIME!

This has worked for me on my Dedicated server. I'm not sure how much permission the other service users get, but i'm guessing it'll work.

Please let me know if something dosn't work, there are indeed some details that I took out, since this is just a guide for none familiar users.
ping [AT] ffxionline [DOT] com

1. Download php-4.4.0.tar.Z <---- When you save make sure the file name is saved RIGHT! (I noticed some browsers rename the file to tar.tar, if that's the case, just rename the file!)

2. Place in /home/ping

3. $ tar -zxf php-4.4.0.tar.Z

4. $ mkdir src

5. $ cd src

6. Download curl-7.14.0.tar.Z and place it in the new src directory <---- When you save make sure the file name is saved RIGHT! (I noticed some browsers rename the file to tar.tar, if that's the case, just rename the file!)

7. $ tar -zxf curl-7.14.0.tar.Z

8. Download imap-2004e.tar.Z and also place it in the new src directory <---- When you save make sure the file name is saved RIGHT! (I noticed some browsers rename the file to tar.tar, if that's the case, just rename the file!)

9. $ tar -zxf imap-2004e.tar.Z

10. Download libmcrypt-2.5.7.tar.Z and also place it in the new src directory <---- When you save make sure the file name is saved RIGHT! (I noticed some browsers rename the file to tar.tar, if that's the case, just rename the file!)

11. $ tar -zxf libmcrypt-2.5.7.tar.Z

12. $ mkdir php

13. $ mkdir libmcrypt

14. $ mkdir curl

15. $ cd curl-7.14.0

16. $ ./configure --prefix=/home/ping/src/curl

17. $ make

18. $ make install

19. $ cd ..

20. $ cd libmcrypt-2.5.7

21. $ ./configure --prefix=/home/ping/src/libmcrypt

22. $ make

23. $ make install

24. $ cd ..

25. $ cd imap-2004e

26. $ make slx SSLTYPE=none (Important: You may get a question asking if you wish to continue, just press 'Y' to continue!)

27. $ mkdir lib

28. $ mkdir include

29. $ cd c-client

30. $ cp *.h ../include/

31. $ cp *.c ../lib/

32. $ cp c-client.a ../lib/libc-client.a

33. $ cd /home/ping/ffxionline.com/

34. $ mkdir cgi-bin

35. $ cd /home/ping/php-4.4.0/

36. $ './configure' '--with-mysql=/usr' '--enable-calendar' '--enable-force-cgi-redirect' '--with-config-file-path=/home/ping/ffxionline.com/cgi-bin/' '--enable-trans-sid' '--with-gd' '--with-ttf=/usr' '--with-freetype-dir=/usr' '--with-exif' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-zlib-dir=/usr' '--enable-ftp''--with-curl=/home/ping/src/curl' '--with-mcrypt=/home/ping/src/libmcrypt' '--with-gettext' '--enable-mbstring=all' '--with-xml' '--prefix=/home/ping/src/php' '--without-pear' '--with-imap=/home/ping/src/imap-2004e'

37. $ make

38. $ make install prefix=/home/ping/src/php

39. $ cp /home/ping/src/php/bin/php /home/ping/ffxionline.com/cgi-bin/php.cgi

40. $ cp /etc/php/php.ini /home/ping/ffxionline.com/cgi-bin/php.ini

41. $ cd /home/ping/ffxionline.com/

42. $ chmod -R 755 cgi-bin

43. $ vi .htaccess

44. Press "insert" key on your keyboard

45. add the following at the top of the screen:
AddHandler php-cgi .php
Action php-cgi /cgi-bin/php.cgi

46. $ chmod 644 .htaccess

47. test it by creating a file in the root www directory called test.php and putting this into it:
<?
php phpinfo();
?>