![]() |
|
Dedicated servers
|
|
|
|
|
|
|
Reference and ManualHosting Glossary PHP HTML 4.01 CSS 2.0 Core Javascript 1.5 XHTML 1.0
Chapter 5. Installation on Unix systemsThis section will guide you through the general configuration and installation of PHP on Unix systems. Be sure to investigate any sections specific to your platform or web server before you begin the process. As our manual outlines in the General Installation Considerations section, we are mainly dealing with web centric setups of PHP in this section, although we will cover setting up PHP for command line usage as well. There are several ways to install PHP for the Unix platform, either with a compile and configure process, or through various pre-packaged methods. This documentation is mainly focused around the process of compiling and configuring PHP. Many Unix like systems have some sort of package installation system. This can assist in setting up a standard configuration, but if you need to have a different set of features (such as a secure server, or a different database driver), you may need to build PHP and/or your webserver. If you are unfamiliar with building and compiling your own software, it is worth checking to see whether somebody has already built a packaged version of PHP with the features you need. Prerequisite knowledge and software for compiling:
The initial PHP setup and configuration process is controlled by the use of the commandline options of the configure script. Our manual documents the different options separately. You will find the core options in the appendix, while the different extension specific options are descibed on the reference pages. When PHP is configured, you are ready to build the module and/or executables. The command make should take care of this. If it fails and you can't figure out why, see the Problems section. Gentoo installation notesThis section contains notes and hints specific to installing PHP on Gentoo Linux. Using Portage (emerge)While you can just download the PHP source and compile it yourself, using Gentoo's packaging system is the simplest and cleanest method of installing PHP. If you are not familiar with building software on Linux, this is the way to go. If you have built your Gentoo system so far, you are probably used to Portage already. Installing Apache and PHP is no different than the other system tools. The first decision you need to make is whether you want to install Apache 1.3.x or Apache 2.x. While both can be used with PHP, the steps given bellow will use Apache 1.3.x. Another thing to consider is whether your local Portage tree is up to date. If you have not updated it recently, you need to run emerge sync before anything else. This way, you will be using the most recent stable version of Apache and PHP. Now that everything is in place, you can use the following example to install Apache and PHP: You can read more about emerge in the excellent Portage Manual provided on the Gentoo website. If you need to use Apache 2, you can simply use emerge apache in the last example. Better control on configurationIn the last section, PHP was emerged without any activated modules. As of this writing, the only module activated by default with Portage is XML which is needed by PEAR. This may not be what you want and you will soon discover that you need more activated modules, like MySQL, gettext, GD, etc. When you compile PHP from source yourself, you need to activate modules via the configure command. With Gentoo, you can simply provide USE flags which will be passed to the configure script automatically. To see which USE flags to use with emerge, you can try:
As you can see from the last output, PHP considers a lot of USE flags. Look at them closely and choose what you need. If you choose a flag and you do not have the proper libraries, Portage will compile them for you. It is a good idea to use emerge -pv again to see what Portage will compile in accordance to your USE flags. As an example, if you do not have X installed and you choose to include X in the USE flags, Portage will compile X prior to PHP, which can take a couple of hours. If you choose to compile PHP with MySQL, cURL and GD support, the command will look something like this: As in the last example, do not forget to emerge php as well as mod_php. php is responsible for the command line version of PHP as mod_php is for the Apache module version of PHP. Common Problems
|
![]() Net Host Tools
Feature Host
We Manage IT Differently ![]() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|