Installation linux apache + php

Warmly recommended: Super Multi IT resources, all in 798 Resource Network

httpd Download:
http://httpd.apache.org/download.cgi#apache24

[A,] mounted reliance
. 1,
yum the install autoconf automake libtool GCC GCC GCC-C ++ + zlib-devel

2. Download APR
Download: http://archive.apache.org/dist/apr/ Also find the latest version
to get the file: apr-1.4.6.tar.gz
unpack: tar -zxvf apr-1.4.6.tar. gz
installation:
./configure --prefix = / usr / local / LAMP / On Apr
the make the make the install &&

3, download APR-util
Download: http://archive.apache.org/dist/apr/ find the latest version
to get the file: apr-util-1.5.1.tar.gz
unpack: tar -zxvf apr-util-1.5 .1.tar.gz
./configure --prefix = / usr / local / LAMP / On Apr-util the -with-On Apr = / usr / local / LAMP / On Apr / bin / On Apr. 1-config-
the make the make the install &&

4, download PCRE
Download: http://jaist.dl.sourceforge.net/project/pcre/pcre/ looking at the latest version
to get the file: pcre-8.32.tar.gz
unpack: tar -zxvf pcre-8.32.tar. GZ
./configure --prefix = / usr / local / LAMP / PCRE
the make the make the install &&

【二、预编译】
./configure --prefix=/usr/local/lamp/apache2 -with-apr=/usr/local/lamp/apr -with-apr-util=/usr/local/lamp/apr-util -with-pcre=/usr/local/lamp/pcre --enable-so --enable-deflate=shared --enable-expires=shared --enable-rewrite=shared

Parameter Description:
-prefix specify the location of files are stored BUILD
-sysconfdir specify the location of the configuration file stored
-with-included-apr improve coding efficiency
-enable-so designated Apache supports dynamic module
-enable-deflate = shared deflate the support site compression module
-enable-expires = shared support site caching technology module
-enable-rewrite = shared support website address rewriting

[Third, compile and install]
make && make install

【【php安装】】
参考文档:
http://blog.csdn.net/qq_14912373/article/details/48915823
http://www.cnblogs.com/tujia/p/5392319.html
http://www.yanshiba.com/archives/727
http://blog.csdn.net/ys743276112/article/details/51648243
(1、安装基础库)
yum install gd zlib zlib-devel openssl openssl-devel libxml2 libxml2-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libmcrypt libmcrypt-devel
(2、预编译)
./configure --prefix=/usr/local/php -with-apxs2=/usr/local/apache2/bin/apxs
–with-gd
–with-freetype-dir
–enable-gd-native-ttf
–enable-mysqlnd
–with-pdo-mysql=mysqlnd
–with-openssl
–with-mcrypt
–enable-mbstring
–enable-zip
–enable-fpm

Parameters:
the -with-apxs2 let appache load php

(3, compile and install)
the make the make the install &&
(. 4, copying the configuration file)
CP /usr/ruanjian/php-5.5.38/php.ini-development /usr/local/php/lib/php.ini
CP / usr /local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf

(5、让appace 解析 php)
LoadModule php5_module modules/libphp5.so
AddType application/x-httpd-php .php

vim httpd.conf to add a second line below the first line above.

(6, add the environment variable)
modify / etc / profile file so that permanent force, and all users of the system to take effect at the end of file add the following two lines of code

PATH=$PATH:/usr/local/lamp/php/bin:/usr/local/lamp/mysql/bin
export PATH

Run the source / etc / profile or execute command ./profile point it changes to take effect, the implementation can be done to see if the success by adding echo $ PATH command.

(7, # start php-fpm)

/usr/local/php/sbin/php-fpm

Reference website:
http://www.cnblogs.com/tujia/p/5392319.html

Guess you like

Origin blog.csdn.net/xianhenyuan/article/details/92794726