O'Reilly logo

PHP in a Nutshell by Paul Hudson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Installing on Unix

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 Using Packages

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required