문제

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