Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mvanemmerik's avatar

PHP Catchable fatal error

I'm receiving this error when I'm trying to move my Laravel project to another server. Any ideas?

-- [RuntimeException]
Error Output: PHP Catchable fatal error: Argument 1 passed to Illuminate\
Foundation\Application::detectEnvironment() must be an instance of Closure
, array given, called in /Users/mvanemmerik/song-list/bootstrap/environmen
t.php on line 18 and defined in /Users/mvanemmerik/song-list/vendor/larave
l/framework/src/Illuminate/Foundation/Application.php on line 290
PHP Stack trace:
PHP 1. {main}() /Users/mvanemmerik/song-list/artisan:0
PHP 2. require_once() /Users/mvanemmerik/song-list/artisan:30
PHP 3. require() /Users/mvanemmerik/song-list/bootstrap/start.php:27
PHP 4. Illuminate\Foundation\Application->detectEnvironment() /Users/mva
nemmerik/song-list/bootstrap/environment.php:18

Thanks.

0 likes
4 replies
uxweb's avatar

Are you using L4 or L5?, if using L5, check your bootstrap/environment.php file.

mvanemmerik's avatar

I'm using L5. Here's my environment.php file. I'm fairly new at Laravel, so I appreciate the help.

$env = $app->detectEnvironment([

'local' => ['homestead'],

]);

mvanemmerik's avatar

I updated the environment.php file, now, I'm receiving this error:

Fatal error: Call to undefined method Illuminate\Foundation\Application::bindInstallPaths()

aliqsyed's avatar
Level 29

As of this update there is no environment.php anymore

https://github.com/laravel/laravel/commit/430134864642346498631ad562765d69599d6b39

You will see that the environment.php file has been taken out completely. You need to make sure that your project is current with laravel/laravel on github and after that run a composer update. Environment configuration is now done by defining APP_ENV in your .env file. This is an example of .env file

APP_ENV=local
DB_HOST=localhost
DB_NAME=mydbname
DB_USERNAME=homestead
DB_PASSWORD=secret
1 like

Please or to participate in this conversation.