# Troubleshooting Problems Installing Craft CMS on Laravel Homestead

- Link: https://cagrimmett.com/2018/04/02/craft-cms-installation-problems/
- Published: 2018-04-02T00:12:00-04:00
- Author: Chuck Grimmett

Today I installed [Craft CMS](http://craftcms.com) in for a new [Praxis](http://discoverpraxis.com)
project. I use [Laravel Homestead](https://laravel.com/docs/5.6/homestead) for my
local development environment. It installs like pretty much every other PHP app 
on Homestead ([use this guide by Matt Collins](https://medium.com/@mattcollins_6/setting-up-a-local-dev-environment-for-craft-cms-using-laravel-homestead-2724be3954a5)
if you aren’t very familiar with Homestead), but I ran into a few annoying errors
along the way:

## Mcrypt is required

If `Mcrypt is required` shows when you first go to http://yoursite.local/admin to
finish the install, it is probably because you are a good citizen and your Homestead
box is actually up to date, running PHP 7.2 as the default. Here’s the issue: [mcrypt was removed from PHP 7.2](https://secure.php.net/manual/en/migration71.deprecated.php).
Craft 2 still needs it. There are three solutions:

 * If you need PHP 7.2, you’ll have to install [Craft 3](https://github.com/craftcms/craft).
   It is still under development as of this writing, so I didn’t take that path.(
   _Update April 2, 2018 – Apparently Craft 3 is launching on April 4, so you won’t
   have this issue for long!_)
 * [You can install the mcrypt extension for PHP 7.2.](https://serverpilot.io/community/articles/how-to-install-the-php-mcrypt-extension.html)
 * You can use a different PHP version. I took this route. Homestead makes this 
   super simple by [allowing multiple PHP versions](https://laravel.com/docs/5.6/homestead#multiple-php-versions).
   In your `Homestead.yaml`, set the php variable to `php: "7.0"` under your site
   in the Sites block. Here is what mine looks like:

    ```language-yaml
    - map: craft-praxis.local      to: /home/vagrant/craft-praxis/public      php: "7.0"
    ```

## GROUP BY incompatible with sql_mode=only_full_group_by

If you see this message, chances are that you are using MySQL 5.7.5+, which changed
the way it deals with GROUP BY. [See this StackOverflow post](https://craftcms.stackexchange.com/questions/12084/getting-this-sql-error-group-by-incompatible-with-sql-mode-only-full-group-by/12106)
for the two solutions: Removing the `ONLY_FULL_GROUP_BY` option from sql_mode or
adding the `initSQLs` database config settings in `craft/config/db.php`.
