Loading, please wait...

picture of me
Joe Rushton Fullstack Web Developer

How to install OAuth on Homestead with PHP 5.6

15th August 2017 Reading Time: 2 mins
Tags: PHP Server Stuff

Since OAuth doesn't always play well with scotchbox - which was my primary choice of virtual development environment at the time of writing this - here's a guide on setting it up with homestead 6 or above on PHP 5.6.

 First setup your Homestead.yaml file to use PHP 5.6 for your site, E.g.

    - map: vet-channel.app
      to: /home/vagrant/Code/project/name/app/webroot
      php: "5.6"

(nb: when working with cakePHP projects, it's important to point to the webroot directory, likewise /public for laravel etc)

Next you need to rebuild your vhosts file by either running vagrant up --provision or vagrant reload --provision

At this point you may want to add phpinfo() to your index.php file to ensure your running on php 5.6

Now ssh into your homestead box with vagrant ssh and run the following commands:

Get the latest APT package information

sudo apt-get update

Install OAuth

sudo apt-get install php5.6-oauth

Open up the php configuration file

sudo nano /etc/php/5.6/fpm/php.ini

Add this line: 


and save and exit, then restart php / nginx:

sudo service php5-fpm reload
sudo service nginx reload

The same should apply to other versions of PHP available within homestead. Just replace 5.6 with the appropriate version used in your Homestead.yaml file.

Back to Homepage

Find me on social media