php编译安装及fastcgi使用
开始 PHP 之旅wget http://cn2.php.net/distributions/php-5.6.29.tar.gz
##下载php包
yum install -y libxml2-devel openssl-devel libcurl-devel libjpeg-devel libpng-devel libicu-devel openldap-devel
##增加兼容性
tar xf php-5.6.29.tar.gz
cd php-5.6.29
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#添加组
groupadd www
#添加php-fpm用户
useradd -c php-fpm-user -g www -M php-fpm
./configure
--prefix=/usr/local/php\
--with-libdir=lib64\
##如果64位操作系统,指定为/usr/lib64为默认库路径
--enable-fpm\
--with-fpm-user=php-fpm\
--with-fpm-group=www\
--enable-mysqlnd\
--with-mysql=mysqlnd\
--with-mysqli=mysqlnd\
--with-pdo-mysql=mysqlnd\
--enable-opcache\
##PHP编译字节码缓存,如果需要将 Xdebug 扩展和 OPcache 一起使用,必须在 Xdebug 扩展之前加载 OPcache 扩展
--enable-pcntl\
##进程控制,默认关闭,编译开启
--enable-mbstring\
##宽字符支持
--enable-soap\
##简单对象访问协议,使用xml传输数据,目前已经不常用
--enable-zip\
##zip文件处理
--enable-calendar\
##日历处理
--enable-bcmath\
##任意精度数学扩展
--enable-exif\
##(可交换图像文件格式),专门为数码相机和照片设定,记录数码照片的属性信息和拍摄数据
--enable-ftp\
--enable-intl\
##国际化支持
--with-openssl\
##支持ssl加密
--with-zlib\
--with-curl\
--with-gd\
--with-zlib-dir=/usr/lib\
--with-png-dir=/usr/lib\
--with-jpeg-dir=/usr/lib\
--with-gettext\
##语言翻译
--with-mhash\
##hash库支持
--with-ldap
##ldap支持
make && make install
1
2
3
./configure--prefix=/usr/local/php --with-libdir=lib64 --enable-fpm --with-fpm-user=php-fpm --with-fpm-group=www --enable-mysqlnd --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-opcache --enable-pcntl --enable-mbstring --enable-soap --enable-zip --enable-calendar --enable-bcmath --enable-exif --enable-ftp --enable-intl --with-openssl --with-zlib --with-curl --with-gd --with-zlib-dir=/usr/lib --with-png-dir=/usr/lib --with-jpeg-dir=/usr/lib --with-gettext --with-mhash --with-ldap
##复制版本
页:
[1]