danog.github.io/php.sh

112 lines
3.3 KiB
Bash
Raw Normal View History

2017-06-26 22:07:34 +02:00
# If you add some configuration command, add the dependencies here
2017-06-03 12:57:36 +02:00
apt-get update
apt-get -y dist-upgrade
2017-07-25 18:49:18 +02:00
apt-get install -y binutils-dev libicu-dev libmcrypt-dev libssl-dev libcurl4-openssl-dev libbz2-dev libxml2-dev libpng-dev libjpeg-dev libedit-dev libgmp-dev openssl bc libbison-dev bison build-essential git-core vim curl pkg-config libgmp-dev autoconf libopus-dev libreadline-dev libncurses5-dev
2017-08-23 11:03:00 +02:00
apt-get purge -y 'php*'
2017-06-26 22:07:34 +02:00
if [ -d php-script-stuff/ ]; then
2017-06-03 12:57:36 +02:00
rm -rf php-script-stuff
fi
mkdir php-script-stuff
cd php-script-stuff
2017-06-26 22:07:34 +02:00
if [ -d php-src/ ]; then
2017-06-03 12:57:36 +02:00
rm -rf php-src/
fi
git clone https://github.com/php/php-src.git php-src
cd php-src
2017-08-27 00:09:00 +02:00
git checkout PHP-7.1.9
2017-06-03 12:57:36 +02:00
./buildconf --force
PHP_TIMEZONE="UTC"
PHP_DIRECTORY="/etc/php7ts"
./configure --prefix=$PHP_DIRECTORY --with-config-file-path=$PHP_DIRECTORY --with-config-file-scan-dir=$PHP_DIRECTORY/conf.d --enable-maintainer-zts --with-curl --with-openssl --with-gd --enable-gd-native-ttf --enable-intl --enable-mbstring --with-mcrypt --with-mysqli=mysqlnd --with-zlib --with-bz2 --enable-exif --with-pdo-mysql=mysqlnd --with-libedit --enable-zip --enable-pdo --enable-pcntl --enable-sockets --enable-mbregex --with-tsrm-pthreads --enable-bcmath --enable-fpm --with-xml --enable-xml --with-fpm-group=pwrtelegram --with-fpm-user=pwrtelegram --enable-ctype --with-gmp
make -j 16
make install
cp -a /etc/php7ts/* /usr/
2017-07-23 17:12:34 +02:00
[ ! -d $PHP_DIRECTORY/conf.d ] && mkdir $PHP_DIRECTORY/conf.d
2017-06-26 22:07:34 +02:00
if [ -d ../pthreads/ ]; then
2017-06-03 12:57:36 +02:00
rm -rf ../pthreads
fi
git clone https://github.com/SirSnyder/pthreads -b feature/nested_volatiles ../pthreads
cd ../pthreads
phpize
./configure --with-php-config=$PHP_DIRECTORY/bin/php-config
2017-08-05 19:04:37 +02:00
make -j$(nproc)
2017-06-03 12:57:36 +02:00
make install
2017-06-26 22:07:34 +02:00
if [ -d ../PHP-CPP/ ]; then
2017-06-03 12:57:36 +02:00
rm -rf ../PHP-CPP
fi
git clone https://github.com/CopernicaMarketingSoftware/PHP-CPP ../PHP-CPP
cd ../PHP-CPP
2017-08-05 19:04:37 +02:00
make -j$(nproc)
2017-06-03 12:57:36 +02:00
make install
2017-06-26 22:07:34 +02:00
if [ -d ../PrimeModule-ext/ ]; then
2017-06-03 12:57:36 +02:00
rm -rf ../PrimeModule-ext
fi
2017-06-03 13:32:42 +02:00
git clone https://github.com/danog/PrimeModule-ext ../PrimeModule-ext
2017-06-03 12:57:36 +02:00
cd ../PrimeModule-ext
2017-08-05 19:04:37 +02:00
make -j$(nproc)
2017-06-03 12:57:36 +02:00
make install
2017-07-01 14:35:48 +02:00
git clone https://github.com/openssl/openssl ../openssl
cd ../openssl
git checkout OpenSSL_1_0_2-stable
2017-08-05 19:04:37 +02:00
CFLAGS=-fPIC ./config shared --prefix=/usr/local/ssl && make -j$(nproc) all && make install_sw
2017-07-01 14:35:48 +02:00
2017-06-26 22:07:34 +02:00
git clone --recursive https://github.com/danog/php-libtgvoip ../php-libtgvoip
cd ../php-libtgvoip
2017-08-05 19:04:37 +02:00
make -j$(nproc)
2017-06-26 22:07:34 +02:00
make install
cd ..
LUA_DOWNLOAD_URL=http://www.lua.org/ftp/
LUA_VERSION=5.2.1
LUA_GET_URL=${LUA_DOWNLOAD_URL}lua-${LUA_VERSION}.tar.gz
PHP_LUA_DOWNLOAD_URL=http://pecl.php.net/get/lua-2.0.3.tgz
PHP_VERSION=$(php-config --phpapi)
2017-06-28 10:54:38 +02:00
wget $LUA_GET_URL $PHP_LUA_DOWNLOAD_URL
tar -xf lua-${LUA_VERSION}.tar.gz
2017-06-28 10:25:27 +02:00
tar -xf lua-2.0.3.tgz
2017-06-03 12:57:36 +02:00
cd lua-${LUA_VERSION}
sed -i 's/CFLAGS= -O2/CFLAGS= -fPIC -O2/g' src/Makefile
make linux test
make linux install
2017-06-28 10:54:38 +02:00
cd ..
2017-06-28 10:54:38 +02:00
cd lua-2.0.3
phpize
2017-06-28 10:54:38 +02:00
autoreconf -f -i
./configure --with-lua=/usr/local
make
make install
2017-06-03 12:57:36 +02:00
cd ../..
2017-08-26 22:57:01 +02:00
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
2018-01-13 19:38:08 +01:00
EXPECTED_SIGNATURE=$(wget -q -O - https://composer.github.io/installer.sig)
ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');")
if [ "$ACTUAL_SIGNATURE" != "$EXPECTED_SIGNATURE" ]
then
echo 'ERROR: Invalid installer signature'
rm -rf composer-setup.php
else
php composer-setup.php --filename=composer --install-dir=/usr/bin
rm -rf composer-setup.php
fi
2017-06-03 12:57:36 +02:00
rm -rf php-script-stuff