0

I am getting something really weird.

So I use Laravel projects with vagrant already. But I need to install Symfony2. Therefore I adapt my Homestead.yaml files on both PC and Laptop(both systems running Linux Mint 17.3, KDE). I added the latest vagrant box add laravel/homestead, which is atm 0.5.0 on both systems.

Homestead.yaml then looks on both systems like this:

---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: ~/Projects
      to: /home/vagrant/Projects

sites:
    -(laravel projects)
    - map: pma.local
      to: /home/vagrant/Projects/phpMyAdmin-4.6.0-english/
    - map: symfony.local
      to: /home/vagrant/Projects/symfony/web/
      type: symfony

databases:
    - symfony

Then I add as root in the /etc/hosts file the following line like this on both systems.

192.168.10.10   other-laravel-projects.local pma.local symfony.local

After that I vagrant up && vagrant ssh. As vagrant, I do

$ sudo curl -LsS https://symfony.com/installer -o /usr/local/bin/symfony
$ sudo chmod a+x /usr/local/bin/symfony
$ symfony new symfony 2.8

After that, I still cannot access the http://symfony.local/config.php. So I add my IP address, which I can figure out via

var_dump($_SERVER['REMOTE_ADDR'])

in /web/config.php

if (!in_array(@$_SERVER['REMOTE_ADDR'], array(
    '127.0.0.1',
    '::1',
    'my.ip.address.1',
))) {
    header('HTTP/1.0 403 Forbidden');
    exit('This script is only accessible from localhost.');
}

Then I can finally access http://symfony.local/config.php. The problem is on my PC symfony's Configuration Checker says All checks passed successfully. Your system is ready to run Symfony applications.

But on my laptop, symfony's Configuration Checker says RECOMMENDATIONS To enhance your Symfony experience, it's recommended that you fix the following:

  1. intl extension should be available Install and enable the intl extension (used for validators).

I tried composer require symfony/intl first, which did not fix it. Then I looked for php.ini files. The PC box has /etc/php 5.5/5.6/7.0 folders, whereas the laptop box only has 5.6/7.0, but not sure, whether that's it. Shouldn't they be the same anyway, isn't that the purpose of the boxes, to provide the same setup?

metanerd
  • 713
  • 1
  • 6
  • 21
  • [Creating a symfony development environment with vagrant](http://www.inanzzz.com/index.php/post/igtq/creating-a-symfony-development-environment-with-vagrant) - it it helps. – BentCoder Jul 12 '16 at 13:28
  • Thank you, but updating the whole components involved solved it. I would delete it, but maybe someone finds it useful. Your link looks like fun though. Thankfully I don't have to work through it. – metanerd Jul 12 '16 at 16:39

1 Answers1

0

Seems like I had an outdated vagrant or virtualbox installation or an outdated Homestead folder(https://github.com/laravel/homestead) on laptop, which led to the failed config check.

Checklist: 1. Update vagrant 2. Update provider(e.g. virtualbox) 3. Update Homestead folder 4. Check ~/.homestead/Homestead.yaml and /etc/hosts 5. Update vagrant box outdated

Changing Homestead.yaml needs vagrant provision to take effect, when the box is already running.

metanerd
  • 713
  • 1
  • 6
  • 21