Lamp (Linux + Apache + MySQL + PHP) Deployment log

Source: Internet
Author: User
Document directory
  •  

This document describes how to install lamp.

I use the RedHat Enterprise 5x64 Linux

Step 1: Install MySQL

MySQL installation is relatively simple. To avoid file failures, I downloaded and installed the following four RPM packages one by one.

MySQL-server-community-5.1.46-1.rhel5.x86_64.rpm

MySQL-client-community-5.1.46-1.rhel5.x86_64.rpm

MySQL-devel-community-5.1.46-1.rhel5.x86_64.rpm

MySQL-shared-community-5.1.46-1.rhel5.x86_64.rpm

Step 2: install Apache

In fact, it is to install httpd under the Apache project.

1. download files from http://httpd.apache.orgHttpd-2.2.14.tar.bz22.

2. Extract
$ Bzip2-D httpd-2.2.14.tar.bz2
$ Tar-xvf httpd-2.2.14.tar

3. Configuration
$ Httpd-2.2.14 CD
$./Configure -- prefix =/usr/local/Apache -- enable-so

To be installed in the path/usr/local/Apache.

4. Compile and install
$ Make
$ Make install

Will be installed under/usr/local/Apache specified by -- prefix

6. Customize the configuration file
$ VI/usr/local/Apache/CONF/httpd. conf

7. Test
Start Apache HTTP Server Bu running:
$
/Usr/local/Apache/bin/apachectl-K start
It shoshould be able to request your first document via http: // localhost. The document is located inDocumentRoot,Which is set in HTTP. conf.
Stop the server
$/Usr/local/Apache/bin/apachectl-K stop

Step 3: install PHP

  1. Download from http://cn.php.netPhp-5.2.13.tar.bz2
  2. Extract
    $ Bzip2-D php-5.2.13.tar.bz2
    $ Tar-xvf php-5.2.13.tar
  3. Configuration
    $ Php-5.2.13 CD
    $./Configure -- prefix =/usr/local/PhP5 -- with-apxs2 =/usr/local/Apache/bin/apxs -- With-MySQL

At this time, the cannot find libmysqlclient under/usr error will occur.

This may be because libmysqlclient. So is under/usr/lib64, and is copied to/usr/lib.

At this time, it passes.

Here -- with-apxs2 =/usr/local/Apache/bin/apxs should be associated with Apache, generate libphp5.so

  1. Compile
    $ Make
  2. Test
    $ Make test
  3. Install
    $ Make install
  4. Copy PHP. ini-Dist to the/usr/local/PHP/etc directory indicated by "with-config-file-path" and rename it PHP. ini
  5. Modify the httpd. conf file of Apache.Add addtype application/X-httpd-PHP. php
    Note:
    Loadmodule php5_module modules/libphp5.so is not commented out.

So far, the configuration has been completed.

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.