forked from kasparsd/php-7-debian
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·75 lines (67 loc) · 2.06 KB
/
build.sh
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
#!/bin/bash
cd "$(dirname "$0")"
# Use all cores for the build process
CORE_COUNT=$(cat /proc/cpuinfo | grep -c processor)
# Allow JOB_COUNT environment variable to override the job count
JOB_COUNT=${JOB_COUNT:-$CORE_COUNT}
# Dependencies
sudo apt-get update
sudo apt-get install -y \
build-essential \
pkg-config \
git-core \
autoconf \
bison \
libxml2-dev \
libbz2-dev \
libicu-dev \
libssl-dev \
libcurl4-openssl-dev \
libltdl-dev \
libjpeg-dev \
libpng-dev \
libreadline-dev
sudo mkdir /usr/local/php7
git clone https://github.com/php/php-src.git
cd php-src
git fetch --tags --prune
git checkout tags/php-7.2.5
./buildconf --force
CONFIGURE_STRING="--prefix=/usr/local/php7 \
--enable-huge-code-pages \
--with-config-file-scan-dir=/usr/local/php7/etc/conf.d \
--enable-bcmath \
--with-bz2 \
--enable-calendar \
--enable-intl \
--enable-exif \
--enable-dba \
--enable-ftp \
--with-gettext \
--with-gd \
--with-jpeg-dir \
--enable-mbstring \
--with-mhash \
--enable-mysqlnd \
--with-mysql-sock=/var/run/mysqld/mysqld.sock \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-openssl \
--enable-pcntl \
--enable-shmop \
--enable-soap \
--enable-sockets \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-wddx \
--with-zlib \
--enable-zip \
--with-readline \
--with-curl \
--enable-fpm \
--with-fpm-user=www-data \
--with-fpm-group=www-data"
./configure $CONFIGURE_STRING
make -j "$JOB_COUNT"
sudo make install