Sorry,
I am wrong
Horde FAQ;
Does Horde work with PHP5?
[Horde 2.x]: No.
[Horde 3.x]: Yes.
For a detailed answer read this article.
How do I build Apache with PHP?
The following is not meant to spare you from having to read the installation instructions that come with PHP and Apache, but since some of the steps aren't exactly intuitive, the general procedure is as follows:
1. If your Horde components require PHP support for specific packages (such as IMAP or database support), obtain and install those packages.
2. Obtain and untar Apache and PHP.
3. Move into the apache directory and run ./configure once. Don't worry about arguments for now; this run is just to put things that PHP requires in place.
4. Move to the php directory and run ./configure --help. Make sure that you note all of the options that your components need.
5. Run ./configure. A basic configuration with MySQL and IMAP support would be ./configure --with-apache=../apache-1.3.12 --with-mysql=/usr/local/mysql --with-imap=../imap-4.7c where ../apache-1.3.12 is your Apache source directory, and ../imap-4.7c is your UW-IMAP source directory, and /usr/local/mysql is your MySQL installation directory.
6. Run make install. If all is successful, PHP is installed and ready to go.
7. Change back to the Apache directory and run ./configure --help. Make sure that you note all of the options your local configuration needs.
8. Run ./configure. A basic configuration with PHP version 4 would be ./configure --activate-module=src/modules/php4/libphp4.a. Note that the file src/modules/php4/libphp4.a does not exist yet. While that seems wrong, that's how it's supposed to work, and it will be built when Apache builds.
9. Run make and make install. You now have a PHP-enabled Apache installed.
http://wiki.horde.org/FAQ/Admin/Prerequisites?referrer=FAQ/Admin#toc5