Вопрос

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?

Это было полезно?

Решение

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

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top