Apache2.0 and PHP5.0 installation details _ PHP Tutorial

Source: Internet
Author: User
Tags xml parser
Apache2.0 and PHP5.0 installation details. With the development of the times, php is also being updated. here we will introduce PHP5.0 installation, hoping to help those who love PHP. Assume that you have installed the Linux version, and it can With the development of the times, php is also being updated. here we will introduce PHP5.0 installation, hoping to help those who love PHP. Suppose you have installed Linux and it runs correctly. Make sure that a C language compiler that can be run has been installed in the system. Otherwise, our operations will not work. You must also confirm that all related software has been downloaded: The latest MySQL version (MySQL 4.1.3 beta version), which can be downloaded from MySQL.com. The latest PHP version (PHP 5.0.0) can be downloaded from Php.net. Download the latest Apache 2 version (Apache 2.0.50) from Apache.org.

The most important thing is that in these versions, the combination of Apache 2.0 and PHP 5.0 is not seamless, so it should not be used in the same system at the same time. However, this combination should be beneficial to the development system. You may also need the following support libraries: libxml2 library of the latest version (libxml2 2.6.11), which can be downloaded from XmlSoft.org. The latest zlib library (now zlib 1.2.1) is downloaded from Gzip.org. Copy everything to your/tmp sub-directory and decompress it as follows:

 
 
  1. $ cd /tmp
  2. $ tar -xzvf mysql-standard-4.1.3-beta-pc-linux-i686.tar.gz
  3. $ tar -xzvf php-5.0.0.tar.gz
  4. $ tar -xzvf httpd-2.0.50.tar.gz
  5. $ tar -xzvf libxml2-2.6.11.tar.gz
  6. $ tar -xzvf zlib-1.2.1.tar.gz

Installation Support Library

Step 1: Check whether libxml2 or zlib is installed. PHP5.0 requires libxml2 2.6.0 (or a better version than libxml2 2.6.0) and zlib 1.0.9 (or a better version than zlib 1.0.9 ). If neither of the two supported databases is available, the database must be read-only; otherwise, the database enters the next part. At the beginning, compile and install the libxml2 XML parser, which provides PHP5.0 to install the new xml apl:

 
 
  1. $ cd /tmp/libxml2-2.6.11 $ ./configure
  2. $ make && make install

At the end of this step, libxml2 is installed under/usr/local. If you want to install it elsewhere, you should explicitly specify the prefix option in the previous step to the configure settings.

Step 2: perform similar operations on zlib:

 
 
  1. $ cd /tmp/zlib-1.2.1 $ ./configure
  2. $ make && make install

At the end of this step, zlib is also installed under/usr/local. Instead of using the default value, you can use the specified prefix option to install it elsewhere.

Install Apache

Apache uses PHP in two ways: as a dynamic module, it can be loaded to the Web server during running, or as a static module, which can be directly compiled into the Web server code. This article focuses on the first method. To enable PHP to be dynamically loaded using Apache2.0, the Apache server must be compiled with a Dynamic Shared Object (DSO, Dynamic Shared Object. You can pass the -- enable-so parameter to Apache 2.0 configure to make this feature take effect:

 
 
  1. $ cd /tmp/httpd-2.0.50
  2. $ ./configure --prefix=/usr/local/apache2 --enable-so $ make
  3. && make install

This process sets, compiles, and installs the server to/usr/local/apache2. After installing MySQL and Apache, the last step is to compile and install PHP. In this step, the most critical step is to use a series of exciting extension functions to provide PHP configure and the correct file path of the external class library. The above example looks quite complex, but it is not the case: prefix sets the installation path of PHP5. The with-apxs2 tells PHP to look up where Apache 2.0 is located. With-libxml-dir and -- with-zlib-dir tell PHP where libxml2 and zlib libraries are placed. The with-mysql variable activates the regularmySQL extension function. The with-mysqli variable activates the new MySQL function. The with-gd variable activates the GD extension function. The with-zlib variable activates the ZLIB compression library. The enable-sockets variable activates the socket communication feature. Enable-soap variables enable support for SOAP and Web services.

Of course, you can also try other options and extended functions:

 
 
  1. $ ./configure --help

Once configure is complete, you can compile and install PHP.

 
 
  1. $ make
  2. $ make install

It can be noted that these installation processes can automatically install the PHP module in the correct directory for search in Apache 2.0.


Bytes. Suppose you have installed Linux and it can...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.