CentOS下安装配置PHP

安装编译环境

1
# yum install wget gcc gcc-c++ g++ autoconf autoconf2.13 automake make m4

安装配置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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# yum install openssl openssl-devel python-devel libxml2 libxml2-devel zlib-devel pcre-devel libcurl-devel libjpeg-devel libpng-devel libpng12-devel freetype-devel mhash-devel libmcrypt-devel libXpm-devel libedit-devel re2c libxslt libxslt-devel libicu-devel

# wget http://php.net/distributions/php-7.1.16.tar.gz
# tar -zxf php-7.1.16.tar.gz
# cd php-7.1.16
# ./configure --prefix=/data/server/php7 \
--with-config-file-path=/data/server/php7/etc \
--enable-fpm \
--with-fpm-user=www \
--with-fpm-group=www \
--enable-bcmath \
--with-pdo_sqlite \
--with-gettext \
--with-iconv \
--enable-ftp \
--with-sqlite3 \
--enable-xml \
--enable-mbstring \
--enable-sockets \
--enable-zip \
--enable-soap \
--enable-fileinfo \
--enable-exif \
--with-readline \
--with-libedit \
--with-openssl \
--with-zlib \
--with-curl \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-freetype-dir \
--with-libxml-dir \
--with-xpm-dir \
--with-mcrypt \
--with-mhash \
--enable-mysqlnd \
--enable-pdo \
--with-mysqli \
--with-pdo-mysql \
--without-pear \
--with-libdir=lib64 \
--with-mysql-sock \
--enable-opcache \
--enable-fastcgi \
--enable-intl \
--with-xsl \
--disable-cgi
# make
# make install
# cd /data/server/php7/etc/
# cp php-fpm.conf.default php-fpm.conf
# cp php-fpm.d/www.conf.default php-fpm.d/www.conf
# ln -s /data/server/php7/bin/* /usr/bin/
# ln -s /data/server/php7/sbin/* /usr/bin/
# php -v

el6(CentOS 6)手动安装依赖

libicu-devel: https://pkgs.org/download/libicu-devel

1
# rpm -ivh libicu-devel-4.2.1-14.el6.x86_64.rpm

libmcrypt: https://pkgs.org/download/libmcrypt

1
# rpm -ivh libmcrypt-2.5.8-9.el6.x86_64.rpm

libmcrypt-devel: https://pkgs.org/download/libmcrypt-devel

1
# rpm -ivh libmcrypt-devel-2.5.8-9.el6.x86_64.rpm

libedit-devel: https://pkgs.org/download/libedit-devel

1
2
# yum install ncurses-devel
# rpm -ivh libedit-devel-2.11-4.20080712cvs.1.el6.x86_64.rpm

国内镜像

http://mirrors.ustc.edu.cn/epel/6/x86_64/Packages/l/
http://mirrors.hust.edu.cn/epel/6/x86_64/Packages/l/

Powered by AppBlog.CN     浙ICP备14037229号

Copyright © 2012 - 2020 APP开发技术博客 All Rights Reserved.

访客数 : | 访问量 :