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
- Download from http://cn.php.netPhp-5.2.13.tar.bz2
- Extract
$ Bzip2-D php-5.2.13.tar.bz2
$ Tar-xvf php-5.2.13.tar
- 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
- Compile
$ Make
- Test
$ Make test
- Install
$ Make install
- Copy PHP. ini-Dist to the/usr/local/PHP/etc directory indicated by "with-config-file-path" and rename it PHP. ini
- 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.