安装必要的依赖关系:
1
|
yum -y install libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel bzip2 bzip2-devel curl curl-devel openssl openssl-devel gd gd-devel libmcrypt libmcrypt-devel pcre pcre-devel libaio
|
安装必要的工具:
1
|
yum -y install gcc gcc-c++ make
|
编译安装mcrypt:
1.首先安装Libmcrypt:
下载地址:http://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/
1
2
3
4
5
|
tar -zxvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8
./configure
make
make install
|
2.安装mhash
下载地址:http://sourceforge.net/projects/mhash/files/mhash/0.9.9.9/
1
2
3
4
5
|
tar -zxvf mhash-0.9.9.9.tar.gz
cd mhash-0.9.9.9
./configure
make
make install
|
3.安装mcrypt
下载地址:http://sourceforge.net/projects/mcrypt/files/MCrypt/2.6.8/
?
1
2
3
4
5
6
|
tar -zxvf mcrypt-2.6.8.tar.gz
cd mcrypt-2.6.8
export LD_LIBRARY_PATH=/usr/local/lib
./configure
make
make install
|
编译安装Nginx
1
2
|
./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_stub_status_module
make && make install
|
编译安装MYSQL
下载MYSQL源码,按照INSTALL-BINARY文档里面的说明部署即可~
编译安装PHP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
PHP编译参数:
./configure --prefix=/usr/local/php \
--with-libxml-dir \
--with-zlib \
--with-curl \
--enable-exif \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-freetype-dir \
--with-gettext \
--with-openssl \
--with-mcrypt \
--with-mysql=/usr/local/mysql \
--with-mysqli=/usr/local/mysql/bin/mysql_config \
--with-pdo-mysql=/usr/local/mysql \
--enable-soap \
--with-iconv \
--with-pear \
--enable-sockets \
--enable-fpm \
--enable-pcntl \
--enable-mbstring \
--enable-fileinfo \
make && make install
将/usr/local/php/etc/下的php-fpm.conf.default 改为 php-fpm.conf
|
PS:
1.一个小技巧,安装完成之后把php目录改成php+版本号,然后再做一个链接到这个目录,方便以后多个版本的替换
1
2
3
|
lrwxrwxrwx. 1 root root 9 6月 22 07:03 php -> php5.6.9/
drwxr-xr-x. 9 root root 4096 6月 21 11:03 php5.6.9
drwxr-xr-x. 9 root root 4096 6月 21 10:38 php7.0.0
|
2.如果安装的是php7,还要把/usr/local/php/etc/php-fpm.d 目录的www.conf.default改成www.conf