0

I'm running Vagrant/Virtual Box on a Windows 10 host.

I originally installed Craft on a Vagrant Scotch Box (https://box.scotch.io/). The admin panel was running a little slow so I tried installing in on a Laravel Homestead box after reading that many developers were using this solution.

I had many problems getting this to work, and when I did get it working the performance problems were worse than with my original installation.

First problem was the missing mcrypt extension in PHP 7. If you Google for a solution, you will see this:

sudo apt-get install php7.1-mcrypt

This command, although it runs ok does not result in the extension actually being installed. phpinfo shows that the extension is still not available.

I tried enabling Apache using the Homestead Yaml settings to see if that made any difference. It did not.

After doing an update and an upgrade in the Ubuntu shell, I was finally able to get the mcrypt extension running with a slightly different command:

sudo apt-get install php-mcrypt

After this I was able to run the Craft installer, but the site was running even slower, CSS files for the admin panel were intermittently failing to load, and database requests were extremely slow.

I started seeing weird MySQL errors, which were apparently a result of an incompatibility with the latest version of MySQL. This problem was resolved by adding the following to the my.cnf file in Ubuntu:

sql_mode = 'STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'

This change did not improve the performance issues however.

I reverted back to Nginx to see if that would fix the problem. It did not. I then destroyed the vagrant box and started again with a brand new box.

This time I was not able to get the mcrpyt extension running at all, using either form of the Ubuntu package installer commands. It kept hanging at one of the "processing triggers" steps.

Homestead works great for Laravel and the performance is snappy, but for me getting it to play nice with Craft has been a disaster.

I am going to stay with Scotch Box for now, which runs on PHP 5.6 & MySQL 5.0.

Note: The "nfs" setting is enabled for both of these vagrant boxes, and vagrant-winnfsd (1.3.1) is installed.

I would be interested to know if anybody else had a similar experience and managed to get everything working?

  • Not an answer to your question, but I know there are many Homestead/Craft users. Maybe try posting in the #devops channel in the Craft Slack group with a link to this thread. craftcms.com/community#slack – Brad Bell Jul 11 '17 at 23:46
1

If you follow the instructions here: Local Development with Vagrant / Homestead and can't get it working, let me know.

That's the exact procedure I use whenever I set it up; I just did it 3 weeks ago to set up a new machine running Homestead without incident.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.