-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-php.env
executable file
·159 lines (119 loc) · 3.19 KB
/
install-php.env
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
#! /bin/bash
if [ ! -d /usr/local/webserver/php ];then
mkdir /usr/local/webserver/php
fi
if [ ! -d /usr/local/webserver/download ];then
mkdir /usr/local/webserver/download
fi
cd /usr/local/webserver/download;
if [ ! -f /usr/local/webserver/download/php-7.1.16.tar.gz ] && [ ! -d /usr/local/webserver/download/php-7.1.16 ] ;
then
wget http://cn2.php.net/distributions/php-7.1.16.tar.gz
tar -zxvf php-7.1.16.tar,gz
cd php-7.1.16
fi
if [ -f /usr/local/webserver/download/php-7.1.16.tar.gz ] && [ ! -d /usr/local/webserver/download/php-7.1.16 ] ;
then
tar -zxvf php-7.1.16.tar.gz
cd /usr/local/webserver/download/php-7.1.16
fi
if [ -d /usr/local/webserver/download/php-7.1.16 ];
then
cd /usr/local/webserver/download/php-7.1.16
fi
echo "Install ext"
yum -y install libxml2-devel
yum -y install libxml2
yum -y install curl
yum -y install curl-devel
yum install -y libwebp libwebp-devel
yum -y install libjpeg libjpeg-devel
yum -y install libpng libpng-devel
yum -y install libXpm libXpm-devel
yum -y install freetype freetype-devel
yum -y install libmcrypt libmcrypt-devel
yum -y install epel-release
yum -y install libmcrypt
yum -y install libmcrypt-devel
yum -y install bzip2 bzip2-devel
yum -y install libxslt-devel
yum -y install readline-devel
yum -y install autoconf
echo "Start to install PHP"
./configure \
--prefix=/usr/local/webserver/php \
--with-config-file-path=/usr/local/webserver/php/etc \
--enable-fpm \
--with-fpm-user=nginx \
--with-fpm-group=nginx \
--enable-inline-optimization \
--disable-debug \
--disable-rpath \
--enable-shared \
--enable-soap \
--with-libxml-dir \
--with-xmlrpc \
--with-openssl \
--with-mcrypt \
--with-mhash \
--with-pcre-regex \
--with-sqlite3 \
--with-zlib \
--enable-bcmath \
--with-iconv \
--with-bz2 \
--enable-calendar \
--with-curl \
--with-cdb \
--enable-dom \
--enable-exif \
--enable-fileinfo \
--enable-filter \
--with-pcre-dir \
--enable-ftp \
--with-gd \
--with-openssl-dir \
--with-jpeg-dir=/usr/lib64/ \
--with-png-dir=/usr/lib64/ \
--with-zlib \
--with-freetype-dir=/usr/lib64/ \
--with-libxml-dir=/usr/lib64/ \
--with-webp-dir=/usr/lib64 \
--with-xpm-dir=/usr/lib64 \
--enable-gd-native-ttf \
--enable-gd-jis-conv \
--with-gettext \
--with-mhash \
--enable-json \
--enable-mbstring \
--enable-mbregex \
--enable-mbregex-backtrack \
--with-libmbfl \
--with-onig \
--enable-pdo \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-zlib-dir \
--with-pdo-sqlite \
--with-readline \
--enable-session \
--enable-shmop \
--enable-simplexml \
--enable-sockets \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-wddx \
--with-xsl \
--enable-zip \
--enable-mysqlnd-compression-support \
--with-pear \
--enable-opcache
make && make install
#cp ./php.ini.production /usr/local/webserver/php/etc/php.ini
cp /usr/local/webserver/download/php-7.1.16/php.ini-production /usr/local/webserver/php/etc/php.ini
cp /usr/local/webserver/php/etc/php-fpm.conf.default /usr/local/webserver/php/etc/php-fpm.conf
cp /usr/local/webserver/php/etc/php-fpm.d/www.conf.default /usr/local/webserver/php/etc/php-fpm.d/www.conf
#ln -s /usr/local/webserver/php/bin/php /usr/local/lib/php
groupadd nginx
useradd nginx -M -s /bin/nologin -g nginx