-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphp-compile.sh
More file actions
executable file
·117 lines (99 loc) · 2.58 KB
/
Copy pathphp-compile.sh
File metadata and controls
executable file
·117 lines (99 loc) · 2.58 KB
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
#!/bin/bash
# Errors
# - configure: error: Your system does not support systemd.
# RUN: ln -s /lib/x86_64-linux-gnu/libsystemd-daemon.so.0 /lib/x86_64-linux-gnu/libsystemd-daemon.so
#
function print_usage()
{
echo "-- Install PHP --"
echo ""
echo "Use: $0 [options] -b <base_version> -v <version>"
echo ""
echo "Options:"
echo "-b : Base Version (ie: 5.6, 7.0)"
echo "-v : Version (ie: 5.6.30, 7.0.0)"
echo ""
exit 1
}
while getopts "b:v:h?" options; do
case $options in
b ) base_version=$OPTARG;;
v ) php_version=$OPTARG;;
h ) print_usage;;
\? ) print_usage;;
* ) print_usage;;
esac
done
[ -z $base_version ] && echo "You must specify the base version" && exit 1
[ -z $php_version ] && echo "You must specify the PHP Version" && exit 1
[ ! -d /root/compiled_php ] && mkdir "/root/compiled_php"
cd /root/compiled_php
if [ ! -f php-${php_version}.tar.bz2 ]; then
wget http://de.php.net/get/php-${php_version}.tar.bz2/from/this/mirror -O php-${php_version}.tar.bz2
fi
tar jxf php-${php_version}.tar.bz2
cd php-${php_version}/
apt-get install build-essential \
libxml2-dev \
libssl-dev \
libbz2-dev \
libmcrypt-dev \
libmhash-dev \
libmysqlclient-dev \
libcurl4-openssl-dev \
libjpeg62-dbg \
libjpeg-dev \
libpng12-dev \
libfreetype6-dev \
libxslt1-dev \
libsystemd-dev \
pkg-config
./configure \
--prefix=/opt/php-${php_version} \
--with-config-file-path=/etc/php/${php_version}/fpm
--with-zlib-dir \
--with-freetype-dir \
--enable-mbstring \
--with-libxml-dir=/usr \
--enable-soap \
--enable-calendar \
--with-curl \
--with-mcrypt \
--with-zlib \
--with-gd \
--disable-rpath \
--enable-inline-optimization \
--with-bz2 \
--with-zlib \
--enable-sockets \
--enable-sysvsem \
--enable-sysvshm \
--enable-pcntl \
--enable-mbregex \
--enable-exif \
--enable-bcmath \
--with-mhash \
--enable-zip \
--with-pcre-regex \
--with-mysql \
--with-pdo-mysql \
--with-mysqli \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--with-openssl \
--with-fpm-user=www-data \
--with-fpm-group=www-data \
--with-fpm-systemd \
--with-libdir=/lib/x86_64-linux-gnu \
--enable-ftp \
--with-gettext \
--with-xmlrpc \
--with-xsl \
--with-kerberos \
--enable-fpm \
--enable-gd-native-ttf
make clean
make
make install
echo "cp /opt/php-${php_version}/sbin/php-fpm /usr/sbin/php-fpm-${php_version}"
echo "cp /opt/php-${php_version}/bin/php /usr/bin/php${php_version}"