Skip to content

Instantly share code, notes, and snippets.

@tonejito
Last active October 17, 2018 16:32
Show Gist options
  • Save tonejito/6095e364525ae249d653fd1eab000b3a to your computer and use it in GitHub Desktop.
Save tonejito/6095e364525ae249d653fd1eab000b3a to your computer and use it in GitHub Desktop.
Install and configure @oerdnj php5.6-fpm on a @Debian 9 host
SHELL=/bin/bash
SURY_REPO=/etc/apt/sources.list.d/sury.list
.PHONY: deploy
deploy: repo install configure restart check
repo:
ifeq (,$(wildcard ${SURY_REPO}))
wget -qcO - 'https://packages.sury.org/php/apt.gpg' | apt-key add -
echo "deb https://packages.sury.org/php/ $(shell lsb_release -sc) main" > ${SURY_REPO}
endif
apt install apt-transport-https lsb-release ca-certificates
apt update
install:
apt install task-web-server php5.6 php5.6-fpm
configure:
a2dismod php5.6
a2enmod proxy_fcgi setenvif
a2enconf php5.6-fpm
apachectl -t
restart:
systemctl restart apache2 php5.6-fpm
systemctl status apache2 php5.6-fpm
check:
netstat -natuplwx | egrep 'apache2|php'
echo '<?php phpinfo();' > /var/www/html/info.php
links -dump http://localhost/info.php > info.log
head -n 16 info.log
rm -v /var/www/html/info.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment