Install CakePHP3 on Laravel Homestead

This guide is not comprehensive, it is assumed that you have already installed Vagrant, Laravel Homestead and VirtualBox. The guide is based on Mac OSX10.10.

CakePHP3 requires the php5-intl extension that at the time of writing is not by default installed on Laravel Homestead. The good news is that it’s easy to install.

First you need to ssh into your Homestead Machine.

Next you need install the php5-intl extension. Also do an update while you’re at it

If you are missing other php5 extensions that you need you can use the above command, just change the php5-extension name.

Now you can install CakePHP3 with composer.

If you prefer to install CakePHP3 a different way please see the CakePHP3 installation documentation.

Now you should be able to visit your CakePHP3 installation using the URL you have setup, example.local etc. You will need to consult the Laravel Homestead Documentation if you’re not sure what this is.

The problem however is that you may see there are no CSSĀ or Javascript files being loaded. The reason for this is because Nginx has set the DocumentRoot incorrectly. It’s easy fixed. More information on using Nginx.

Use cd to change directory into Nginx “Sites Available”. Edit your site config file “example.local” using nano or whatever is applicable to your setup. Find the “root” declaration and edit as follows.

You may need to restart your Homestead Machine.

Now when you load your CakePHP3 installation in your browser it should load all the CSS and Javascript so that it looks correct.

Enjoy, if you have any question leave them in the comments and I’ll do my best to help.

One thought on “Install CakePHP3 on Laravel Homestead

Leave a Reply

Your email address will not be published. Required fields are marked *