Question

I cannot get laravel to run locally.

$env = $app->detectEnvironment(array(

'prod' => array('dossiya-v2'),
'local' => array('ubuntu', 'localhost')
));

and I used

php -S localhost:4000

To start my php server. I keep getting the error: 'Whoops, looks like something went wrong.' unless i change the above code to:

$env = $app->detectEnvironment(
  function(){ return 'local' ; }
);

How can I change it such that I don't have to put in that code?

Was it helpful?

Solution

You need to add whatever comes back from the terminal when you run

hostname

This will likely be something like Your-computer-name.local

So you would add that to your array like this:

$env = $app->detectEnvironment(array(
    'prod' => array('dossiya-v2'),
    'local' => array('ubuntu', 'Your-computer-name.local')
));

See here in the docs: http://laravel.com/docs/configuration#environment-configuration

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top