Configuring PHP 7 and Apache For Use With Laravel 5 After Upgrading to Ubuntu 16.04 LTS
Configuring PHP 7 and Apache For Use With Laravel 5 After Upgrading to Ubuntu 16.04 LTS
Jason Jason Photo By Jason Jason, Aug 22, 2016

Ubuntu 16.04 LTS is finally being supported as the official stable release of Ubuntu, and the exciting part is that it ships with PHP 7 right from the start. PHP 7 is way faster and I'm excited to start using some of the new features, but after I upgraded from Ubuntu 14.04 LTS to Ubuntu 16.04 LTS, I noticed that it broke just about everything on my webserver! After the upgrade, Apache would simply display the php scripts when accessed through a browser (a huge security risk in and of itself, by the way). So here's a quick guide on everything you need to get Laravel 5 (which is my favorite PHP framework) back up and running your server.

Assumptions

  • You've already upgraded to Ubuntu 16.04 LTS
  • You already have PHP 7 running. You can verify if you have this by running php -v
  • You already have MySQL installed
  • You already have Apache installed

Commands

sudo apt-get install php libapache2-mod-php php-mcrypt php-mysql php-cli php-curl php-gd php-json php-mbstring php-zip php-soap php-xml libxml2-dev

sudo service apache2 restart


Tags & Categories

Apache MySQL Laravel PHP