Wireless Army
This is a blog / tips and tricks website for web developers and security researchers.
follow us in feedly


php7 apache2 on debian
by admin
 at 2016-07-28 17:58:00.

So you have heard php7 is super fast and since you are a courious developer you want to try it out.
for this we will use a regular apache2 (not building form source) and mysql. We we build php 7.0.1 form source.
this has beeen tested on both ubuntu and debian based systems.
files for download: php7.zip

If the php version is newer that 7.0.1, just update git checkout PHP-7.0.1number in the ./build.sh file

before you start you might want to run the following command:

if you have built apache from source too, you might want to change the profix in build.sh file to /usr/local/apache2/bin/apxs. you can learn how to do that here

apt-get install apache2 apache2-dev mysql-server mysql-client
cd php-7-debian
./build.sh
./install.sh
/usr/local/php7/bin/php -v

or

ln -s /usr/local/php7/bin/php /usr/bin/php

to be able to do php -v anywhere
Configuration files location:

/usr/local/php7/lib/php.ini
/usr/local/php7/etc/php-fpm.conf
/usr/local/php7/etc/php-fpm.d/www.conf
/usr/local/php7/etc/conf.d/modules.ini
/etc/init.d/php7-fpm

you may get some errors so try the following:

a2dismod mpm_event
a2enmod mpm_prefork rewrite openssl php7

add ServerName localhost to /etc/apache2/apache2.conf
if you see php code and its not executed you might want to add

RewriteEngine On
RewriteRule (.*\.php)s$ $1 [H=application/x-httpd-php-source]
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>

to /etc/apache2/sites-available/000-default.conf

This was done succesfully on a debian based system so if you have any questions, leave it in the comment section down below.

every time you might want to do service apache2 restart to see if the changes have worked

help from kasparsd github