Build apache+mysql+php Environment

Source: Internet
Author: User

1.1 Building apache+mysql+php Environment 1.1.1 about pre-installation preparation

Configuring the Yum Source (/etc/yum.repos.d/) directory will not seek operational support.

Httpd-2.2.29.tar.gz//apache's Source installation package

PHP-5.6.6.TAR.BZ2//php's Source installation package

1.1.2 Installation Process I.Installing MySQL Reference 1.2 II.Install Apache server Step one. Unzip the source to the specified directory

# CD/USR/LOCAL/SRC

# TAR-ZXVF Httpd-2.2.29.tar.gz

Step two. After decompression into the source directory, source code compilation

# CD Httpd-2.2.29

#./configure--prefix=/usr/local/apache--enable-shared=max--enable-module=rewrite--enable-module=so

# make

# make Install

Description:--prefix=/usr/local/apache is a compiled directory.

Step three. Start and stop

#cd/usr/local/apache/bin/

#./httpd–k Start #启动apache

./httpd–k Stop #停止apache

./httpd–k Restart #重启apache

Inspection

After startup, the http://ip/can be entered via a local browser, and if successful, it Works is displayed.

III.Install PHP Step one. Unzip the file into the specified directory and enter the directory

# CD/USR/LOCAL/SRC

# TAR-XJVF PHP-5.6.6.TAR.BZ2

#cd php-5.6.6

Step two. Compiling the installation

#./configure--with-apxs2=/usr/local/apache/bin/apxs--enable-safe-mode--enable-trans-sid--with-xml--with-mysql- -with-mysqli--enable-short-tags--with-gd--with-zlib--with-jpeg--with-png--enable-memory-limit--disable-posix-- With-config-file-path=/usr/local/lib

#make

#make Test

#make Install

Description

--with-mysqli #在4.1 PHP Connection Database with this module to support MySQL more secure

--disable-debug #关闭php内部调试

--enable-safe-mode #打开php的安全模式

--with-xml #支持xml

--with-mysql #支持mysql

--enable-short-tags #支持PHP的短标记

--WITH-GD #支持GD库

--with-zlib #支持zlib

When errors occur during the./configure process, the appropriate packages are installed with Yum for processing.

Yum-y Install Curl-devel #curl

Yum install Libpng-devel #png. H not Found

Yum-y Install Mysql-devel #mysql

--disable-fileinfo #如果内存小于1G./configure need to add this parameter, error "Ext/fileinfo/libmagic/apprentice.lo"

Step three. Configuration

Copy Php.ini-development to/usr/local/lib/php.ini

Cp/usr/local/src/php-5.6.6/php.ini-development/usr/local/lib/php.ini

Vi/usr/local/lib/php.ini

Will

Extension=php_mysql.dll

Extension=php_mysqli.dll

The semicolon in front of the two lines is removed

Iv..Integration apache+php Step one. Enter the Apache configuration directory to open the configuration file

# cd/usr/local/apache/conf

#vi httpd.conf

After the other AddType

AddType application/x-httpd-php. php

AddType Application/x-httpd-php-source. Phps

Step two. Reboot Apache, configuration complete.         Step three. Detection method

The <?phpinfo ()?> test file is created in the/usr/local/apache/htdocs directory, accessed in the browser, and the loading of each module is displayed above.

Build apache+mysql+php Environment

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.