Skip to content

Instantly share code, notes, and snippets.

@gustawdaniel
Created December 24, 2016 16:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gustawdaniel/79aae802d0c99ba3ef633efa441d5863 to your computer and use it in GitHub Desktop.
Save gustawdaniel/79aae802d0c99ba3ef633efa441d5863 to your computer and use it in GitHub Desktop.
Compilation PHP 7.0.14 on BunsenLabs Hydrogen 2016-07-10
<FilesMatch ".+\.ph(p[3457]?|t|tml)$">
SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch ".+\.phps$">
SetHandler application/x-httpd-php-source
# Deny access to raw php sources by default
# To re-enable it's recommended to enable access to the files
# only in specific virtual host or directory
Require all denied
</FilesMatch>
<FilesMatch "^\.ph(p[345]?|t|tml|ps)$">
Require all denied
</FilesMatch>
#!/usr/bin/env bash
php_version="7.0.14";
apt-get update
apt-get install \
make \
autoconf \
gcc \
bison \
apache2-dev \
libxml2-dev \
libssl-dev \
pkg-config \
libbz2-dev \
libcurl4-gnutls-dev \
libjpeg-dev \
libpng-dev \
libxpm-dev \
libfreetype6-dev \
libgmp-dev \
libicu-dev \
libmcrypt-dev \
mysql-server \
libmysqlclient-dev \
libpspell-dev \
librecode-dev \
libsnmp-dev \
apache2
ln -sf /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h
ln -sf /usr/lib/x86_64-linux-gnu/liblber.so /usr/lib/liblber.so
cd /usr/src
git clone -b PHP-${php_version} https://github.com/php/php-src --depth 1
cd php-src
./buildconf --force
./configure --prefix=/usr/local/php/7.0 \
--with-config-file-path=/etc/php/7.0/apache2 \
--with-config-file-scan-dir=/etc/php/7.0/apache2/conf.d \
--enable-mbstring \
--enable-zip \
--enable-bcmath \
--enable-pcntl \
--enable-ftp \
--enable-exif \
--enable-calendar \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-wddx \
--enable-intl \
--with-curl \
--with-mcrypt \
--with-iconv \
--with-gmp \
--with-pspell \
--with-gd \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--with-zlib-dir=/usr \
--with-xpm-dir=/usr \
--with-freetype-dir=/usr \
--enable-gd-native-ttf \
--enable-gd-jis-conv \
--with-openssl \
--with-pdo-mysql=/usr \
--with-gettext=/usr \
--with-zlib=/usr \
--with-bz2 \
--with-recode=/usr \
--with-apxs2=/usr/bin/apxs2 \
--with-mysqli=/usr/bin/mysql_config \
--with-ldap
make clean
make -j `cat /proc/cpuinfo | grep processor | wc -l`
make install
sudo update-alternatives --install /usr/bin/php php /usr/local/php/7.0/bin/php 50 --slave /usr/share/man/man1/php.1.gz php.1.gz /usr/local/php/7.0/php/man/man1/php.1
a2dismod mpm_event
a2enmod mpm_prefork
cp /usr/src/php7.conf /etc/apache2/mods-available/php7.conf
a2enmod php7
service apache2 restart
#!/usr/bin/env bash
ip_hy="192.168.43.48" # ip of hydrogen_x86_64
scp php_install.sh root@${ip_hy}:/usr/src/
scp php7.conf root@${ip_hy}:/usr/src/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment