Installation and configuration of Linux (FedoraCore8) + Apache2.2 + MySQL5 + PHP5

Source: Internet
Author: User
Linux (FedoraCore8) + Apache2.2 + MySQL5 + PHP5 installation configuration-Linux Enterprise Application-Linux server application information. See the following for details. First, download the following installation packages and put them in the same directory:

Httpd-2.2.8.tar.gz (source code package for Apache2.2)

Mysql-5.0.51a-linux-i686-glibc23.tar.gz (MySQL5 binary installation package, preferably under non RPM packages)

Php-5.2.5.tar.gz (PHP5.2.5 source code package)

In fact, although the installation process of LAMP is very simple, figuring out the installation sequence of each part is directly related to the final success or failure. Therefore, let me first talk about the installation sequence and dependency of the above three components (I have assumed that the installation and configuration of Linux have been completed ). Apache and MySQL are mutually independent programs, but the binary programs of Apache (aspx) and MySQL (mysql_config) depend on PHP during installation, that is to say, the installation of PHP must be based on the installation of Apache and MySQL. In this way, we know the installation sequence:

MySQL ---------> Apache ----------> PHP

Now that you know the sequence, you can start the installation. The first is MySQL:

Enter the program directory

# Tar-zxvf mysql-5.0.51a-linux-i686-glibc23.tar.gz (extract the MySQL installation package)

# Mv./mysql-5.0.51a-linux-i686-glibc23/usr/local/mysql (move MySQL to the directory to install, because it is binary, has been compiled)

# Groupadd mysql

# Useradd-g mysql

# Chown-R mysql.

# Chgrp-R mysql.

# Scripts/mysql_install_db -- user = mysql (this command must be executed in the installation directory)

# Chown-R root.

# Chown-R mysql data

# Bin/mysqld_safe -- user = mysql & (run mysql Server)

Step 2 compile and install Apache:

Go to the directory where the apache source package is located

# Tar-zxvf./httpd-2.2.8.tar.gz

# Cd httpd-2.2.8

#./Configure -- prefix =/usr/local/apache2.2 -- enable-so (you must enable apxs support, which is required during PHP compilation)

# Make

# Make install

Step 3 compile and install PHP:

Go to the directory where the PHP source package is located

# Tar-zxvf./php-5.2.5.tar.gz

# Cd php-5.2.5

#. /Configure -- with-config-file-path =/etc -- with-apxs2 =/usr/local/apache2.2/bin/apxs -- with-mysql =/usr/local/mysql --- mysqli =/usr/local/mysql/bin/mysql_config (this step should clarify the installation directory of mysqld and the location of mysql_config file)

# Make

# Make test (to test the correctness of the compilation, if there is an error, you can send it to the PHP official website so that it can improve PHP)

# Make install

# Cp./php. ini-dist/etc/php. ini

Edit the httpd. conf file and add the following statement:

AddType application/x-httpd-php. php

#/Usr/local/apache2.2/bin/apachectl start

Test whether PHP is successfully installed. edit a text file with the following content: Name the file test. php is then placed in the apache webpage directory (/usr/local/apache2.2/htdocs), and http: // ip/test is entered in the browser. php. If the PHP information is displayed and the mysql module contains the content, it indicates that Apache, MySQL, and PHP have been installed successfully.

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.