With the development, php are upgrading, we here introduce PHP5.0 installed, want to help a friend like PHP. Assuming you have installed the Linux version, but it can run correctly. Please be assured the system is already installed can run a C language compiler, otherwise we can not carry out the operation. Moreover, also need to determine all the relevant software has been downloaded: Latest MySQL versions (now MySQL 4.1.3 beta), can be downloaded from MySQL.com. The latest PHP version (now PHP 5.0.0), can be downloaded from the Php.net. The latest version of Apache 2 (now Apache 2.0.50), from Apache.org download.
The most important point is: In these versions, Apache 2.0 and PHP 5.0 is not a seamless integration, it should not be used in the same system. However, this combination should be on the development system is good. You may also need the support of the following libraries: the latest version of the libxml2 library (now libxml2 2.6.11), from XmlSoft.org download. The latest version of the zlib library (now the zlib 1.2.1) download from Gzip.org. All the things that are copied to your / tmp directory, and to extract as follows:
$ Cd / tmp $ tar-xzvf mysql-standard-4.1.3-beta-pc-linux-i686.tar.gz $ tar-xzvf php-5.0.0.tar.gz $ tar-xzvf httpd-2.0.50. tar.gz $ tar-xzvf libxml2-2.6.11.tar.gz $ tar-xzvf zlib-1.2.1.tar.gz
Installation support library
The first step, check if you installed the libxml2 or zlib. PHP5.0 Installation requirements libxml2 2.6.0 (or better than the version of libxml2 2.6.0) and zlib 1.0.9 (or better than zlib 1.0.9 version). If these two support libraries are not, to keep read-only form, or into the next section. Initially, compile and install the libxml2 XML parser, the parser provides PHP5.0 install a new XML APL:
$ Cd / tmp/libxml2-2.6.11 $. / Configure $ make & & make install
The end of this step, libxml2 is installed in / usr / local / under. If you want to install it in other places, you should be clearly specified in the previous step prefix option to configure settings.
Step two: do a similar operation on the zlib:
$ Cd / tmp/zlib-1.2.1 $. / Configure $ make & & make install
The end of this step, zlib was installed in / usr / local / under. You may not use the default value, using the specified prefix option to install it elsewhere.
To Apache to use PHP in two ways: as a dynamic module, which can be loaded in the running state to a Web server, or as a static module, which can be directly translated to the Web server code. For this article, we focus on the first approach. In order to be able to Apache2.0 modules to dynamically load PHP, Apache server must be a dynamic shared object (DSO, Dynamic Shared Object) compilation. Can pass - enable-so parameters to Apache 2.0 configure this feature to take effect:
$ Cd / tmp/httpd-2.0.50 $. / Configure - prefix = / usr/local/apache2 - enable-so $ make & & make install
This process will be set up, compile, and install the server / usr/local/apache2. To complete the installation of MySQL and Apache, the last step shall compile and install PHP. This step, the most crucial step is to use a series of extensions to provide the excitation PHP configure, and the external library file the correct path. The above example looks quite complicated, however, is not the case: prefix set PHP5 installation path. with-apxs2 tells PHP where to find Apache 2.0. with-libxml-dir and - with-zlib-dir tells PHP libxml2 and zlib libraries to place where. variable activation regularmySQL with-mysql extension. with-mysqli MySQL variable activation of additional functions. activation variable with-gd GD extension. variable activation with-zlib ZLIB compression library. enable-sockets variable activation of socket communication features. enable-soap variable activation SOAP and Web services support.
Of course, you can try other options and extensions:
$. / Configure - help
Once the configure has completed, you can compile and install PHP.
$ Make $ make install
It may be noted that these processes can be automatically installed PHP module installed in the correct directory for Apache 2.0 in the search.