Skip to content

Instantly share code, notes, and snippets.

@saade
Created July 25, 2018 12:11
Show Gist options
  • Select an option

  • Save saade/9fbbaaa590aa538d458e1426685ed17f to your computer and use it in GitHub Desktop.

Select an option

Save saade/9fbbaaa590aa538d458e1426685ed17f to your computer and use it in GitHub Desktop.
PHP 7.1 rpi
Step 1 – Add new repository sources
At the time of writing, PHP 7.0 hasn’t yet made the official repository sources, so we need to add one which provides us with the PHP 7.0 packages. Edit your sources file with this command:
sudo nano /etc/apt/sources.list
Below the existing entries in the file on a blank line, add the following two lines:
deb http://repozytorium.mati75.eu/raspbian jessie-backports main contrib non-free
#deb-src http://repozytorium.mati75.eu/raspbian jessie-backports main contrib non-free
Your file should look a little like this:
Install Apache 2 and PHP 7 on Raspberry Pi 3
Next we need to add a couple of certificates in order to allow us to use the sources with apt-get. Run the following two commands:
sudo gpg --keyserver pgpkeys.mit.edu --recv-key CCD91D6111A06851
sudo gpg --armor --export CCD91D6111A06851 | sudo apt-key add -
And finally we need to update the package list by running:
sudo apt-get update
Step 2 – Install the core Apache2 and PHP 7 packages
We’re ready to install Apache2 and PHP7, along with some common packages that we may need for most web applications such as Symfony2, WordPress, Drupal etc. Run the following command to install these packages:
apt-get install apache2 php7.0 php7.0-curl php7.0-gd php7.0-imap php7.0-json php7.0-mcrypt php7.0-mysql php7.0-opcache php7.0-xmlrpc libapache2-mod-php7.0
This may take a little time, but as soon as we’re done, we are essentially finished.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment