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

hengcs's avatar

compiled.php not found after php artisan optimize in Laravel 5.4

Tried to run php artisan optimize but compiled.php is not found in bootstrap/cache directory in fresh install of Laravel 5.4

Tried both php artisan optimize and php artisan optimize --force with same result. The output of the command was

D:\xampp\laravel\laravel5.4
λ php artisan optimize --force
Generating optimized class loader
The compiled services file has been removed.

I changed my .env file to set environment to production and set debug to false.

Here is my .env file

APP_ENV=production
APP_DEBUG=false
APP_LOG_LEVEL=debug
APP_URL=http://localhost

Am I missing anything?

0 likes
3 replies

Please or to participate in this conversation.