Install MySQL + PHP + Apache in Linux

Source: Internet
Author: User

 

Installation steps:

1. mysql

Download the mysql for linux rpm package on the following page

Http://www.mysql.com/downloads/down...3.52-1.i386.rpm;

Http://www.mysql.com/downloads/down...3.52-1.i386.rpm;

Save to the/home/tmp directory

Command list:

Cd/home/tmp

Rpm-ivh MySQL- 3.23.52 -1. i386.rpm # Install mysql server

Rpm-ivh MySQL-client- 3.23.52 -1. i386.rpm # Install mysql client

/Usr/mysql/safe_mysqld & # Start mysql server

Mysql # runs the mysql client and opens the root user's remote access permission. For debugging

Use mysql

Update user set host = '%' where user = 'root' and host <> 'localhost ';

Flush privileges;

Quit

Mysql installation is now complete

2. apache

Download the source code package of apache for linux on the following page

Http://www.apache.org/dist/httpd/apache _ 1.3.26 .Tar.gz;

Save to the/home/tmp directory

Command list:

CD/home/tmp

Tar-zxvf Apache _ 1.3.26 .Tar.gz

MV Apache _ 1.3.26 .Tar.gz Apache

CD Apache

./Configure -- prefix =/usr/local/Apache -- enable-module = so

Make

Make install

Install Apache to/usr/local/Apache and configure Apache to support DSO

3. php

Download the PHP for Linux source code package on the following page

Http://www.php.net/get_download.php? DF = PHP- 4.2.3 .Tar.gz;

Save to the/home/tmp directory

Command list:

CD/home/tmp

Tar-zxvf PHP- 4.2.3 .Tar.gz

Mv php- 4.2.3 .Tar.gz PHP

CD PHP

. /Configure -- prefix =/usr/local/php -- with-apxs =/usr/local/apache/bin/apxs -- with-config-file-path =/usr/local/ lib -- enable-track-vars -- with-xml -- with-mysql

 

Make

Make install

Cp php. ini-dist/usr/local/lib/php. ini

Install php in dso mode to/usr/local/php and set the configuration file directory to/usr/local/lib to enable mysql. xml supports

4. Configuration

Vi/usr/local/apache/conf/httpd. conf

Configure apache as follows:

# Change a line of ServerAdmin q3boy@younet.com to your mailbox address

# DocumentRoot "/home/httpd/html/" is the main directory of the html file.

# Same as above

# Options FollowSymLinks MultiViews for security reasons, remove "Indexes"

#

# DirectoryIndex default. php default. phtml default. php3 default.html default.htm

#

# Set the default file name order of apache

# AddType application/x-httpd-php. php. phtml. php3. inc

# AddType application/x-httpd-php-source. phps

# Set the PHP file suffix

Save disk and exit

Vi/usr/local/lib/php. ini

# Register-golbals = On

Save disk and exit

5. Start the service

/Usr/local/apache/bin/apachectl start

6. Remarks

The default maximum number of processes in apache linux is 256. No matter how httpd. conf is modified, the limit cannot be exceeded. To increase this limit, edit/home/tmp/apache/src/include/httpd before compiling apache. h. Change the line # define HARD_SERVER_LIMIT 256 to # define HARD_SERVER_LIMIT 2048 and then compile apache,

Apache 1.3.26 It seems that mod_so is no longer the default module. -- Enable-module = so must be added during compilation. I did not add this parameter during the first compilation. As a result, apxs cannot be found during php compilation.

Ph P 4.2.3 The default configuration file path appears to have changed. The -- with-config-file-path =/usr/local/lib parameter must be added during compilation. It is useless after I compile php. ini for the first time. Last resort. You can only add this parameter.

P.s. it is not guaranteed that the steps described in this article apply to other versions

Appendix: Related Documents

Php:

Http://www.php.net/get_download.php? Df = php- 4.2.3 .Tar.gz;

Apache:

Http://www.apache.org/dist/httpd/apache _ 1.3.26 .Tar.gz;

MySQL Server:

Http://www.mysql.com/downloads/down...3.52-1.i386.rpm;

Mysql client:

Http://www.mysql.com/downloads/down...3.52-1.i386.rpm

 

Related Article

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.