Skip to content

Instantly share code, notes, and snippets.

@sonnysantino
Last active August 17, 2016 15:28
Show Gist options
  • Save sonnysantino/add4623c79d88185fd3080f833178100 to your computer and use it in GitHub Desktop.
Save sonnysantino/add4623c79d88185fd3080f833178100 to your computer and use it in GitHub Desktop.
Add PHP 7 to an existing forge/homestead

Add ondrje/php repository

sudo add-apt-repository ppa:ondrej/php

Update aptitude

sudo apt-get update

Install php7

sudo apt-get install pkg-php-tools php7.0-common php7.0-curl php7.0-enchant php7.0-gd php7.0-imap php7.0-intl php7.0-ldap php7.0-mcrypt php7.0-readline php7.0-pspell php7.0-tidy php7.0-xmlrpc php7.0-xsl php7.0-json php7.0-sqlite3 php7.0-mysql php7.0-opcache php7.0-bz2 php7.0-fpm php7.0-xml php7.0-dev php7.0-mbstring

Install php modules

sudo apt-get install php-pear php-memcached php-redis php-xdebug php-geoip php-intl php-mcrypt php-mongo

Edit file /etc/php/7.0/fpm/pool.d/www.conf and change user & group properties to your user (forge for forge, vagrant for homestead)

Set php7.0 permissions

sudo chmod 0666 /var/run/php/php7.0-fpm.sock

Edit your nginx sites configuration files by setting fastcgi_pass to unix:/var/run/php/php7.0-fpm.sock;

Restart nginx

sudo service nginx restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment