Installation on Unix can be done in one of two ways: you can use a package manager (such as YaST on SUSE Linux, Yum on Red Hat Linux, or URPMI on Mandriva Linux), or you can compile the programs from source code. If you are configuring a production web server, it is highly recommended that you use your package manager so that patching is kept easy. However, if you're installing PHP onto a local machine for test and programming purposes, you will probably want to compile it yourself to get you extra control.
One major advantage to installing from source code is that you can easily get the latest version of PHP. Many Linux distributions ship only older releases of PHP and Apache in order to ensure the system is stable enough for enterprise use. If you compile from source, you can choose to use an older, more mature release, or the very latest cutting-edge release.
Installing PHP and Apache through your distributions package manager is fast, easy, and usually also provides some extra extensions. For the purpose of this guide, Mandriva Linux 2005 was used, but the process is similar for other distributions.
To get started, open up the Mandriva Control Center and select Add Software. Type
apache2 in the Search box, and click Search to list all packages that relate to Apache. In that list will be a package similar to
apache2-2.0.53-9mdk. Select that, and you'll be prompted to include all the dependencies also (these are required). If you scroll ...