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

nrivero's avatar

RuntimeException on fresh install

I install Laravel with the following command:

composer create-project laravel/laravel --prefer-dist

when its done I go into the laravel directory and do a composer update and it gives me the following error message:

[RuntimeException]                                                                                                                                                                 
  Error Output: PHP Fatal error:  Call to undefined method Illuminate\Foundation\Application::getCachedCompilePath() in /vagrant/laravel/vendor/laravel/framework/src/Illuminate/Fo  
  undation/Console/ClearCompiledCommand.php on line 28

during the update it tries to upgrade the laravel framework from 5.0.16 to 5.0.20

I'm not sure what I can do to correct this. Does anyone know how to fix this?

0 likes
26 replies
thomasjsn's avatar

Try running $ php artisan clear-compiled and run composer again.

1 like
hdoitc's avatar

Same problem. Hebron - Cannot find a file compiled into laravel 5 storage/framework. Only exists folders: cache, sessions, views. Please help.

hdoitc's avatar

$ php artisan clear-compiled PHP Fatal error: Call to undefined method Illuminate\Foundation\Application::getCachedCompilePath() in /Users/hdo/web_projects/project_new/vendor/laravel/framework/src/Illuminate/Foundation/Console/ClearCompiledCommand.php on line 28

sauware's avatar

The same error in "composer update"

Loading composer repositories with package information Updating dependencies (including require-dev)

  • Removing symfony/var-dumper (v2.6.4)

  • Installing symfony/var-dumper (v2.6.5) Loading from cache

  • Removing symfony/translation (v2.6.4)

  • Installing symfony/translation (v2.6.5) Loading from cache

  • Removing symfony/security-core (v2.6.4)

  • Installing symfony/security-core (v2.6.5) Loading from cache

  • Removing symfony/routing (v2.6.4)

  • Installing symfony/routing (v2.6.5) Loading from cache

  • Removing symfony/process (v2.6.4)

  • Installing symfony/process (v2.6.5) Loading from cache

  • Removing symfony/http-foundation (v2.6.4)

  • Installing symfony/http-foundation (v2.6.5) Loading from cache

  • Removing symfony/event-dispatcher (v2.6.4)

  • Installing symfony/event-dispatcher (v2.6.5) Loading from cache

  • Removing symfony/debug (v2.6.4)

  • Installing symfony/debug (v2.6.5) Loading from cache

  • Removing symfony/http-kernel (v2.6.4)

  • Installing symfony/http-kernel (v2.6.5) Loading from cache

  • Removing symfony/finder (v2.6.4)

  • Installing symfony/finder (v2.6.5) Loading from cache

  • Removing symfony/console (v2.6.4)

  • Installing symfony/console (v2.6.5) Loading from cache

  • Removing swiftmailer/swiftmailer (v5.3.1)

  • Installing swiftmailer/swiftmailer (v5.4.0) Loading from cache

  • Removing nikic/php-parser (v1.1.0)

  • Installing nikic/php-parser (v1.2.1) Loading from cache

  • Removing psy/psysh (v0.4.1)

  • Installing psy/psysh (v0.4.3) Loading from cache

  • Removing symfony/filesystem (v2.6.4)

  • Installing symfony/filesystem (v2.6.5) Loading from cache

  • Removing laravel/framework (v5.0.16)

  • Installing laravel/framework (v5.0.20) Loading from cache

  • Removing symfony/yaml (v2.6.4)

  • Installing symfony/yaml (v2.6.5) Loading from cache

Writing lock file Generating autoload files

[Symfony\Component\Debug\Exception\FatalErrorException] Call to undefined method Illuminate\Foundation\Application::getCachedCompilePath()

Script php artisan clear-compiled handling the post-update-cmd event returned with an error

thomasjsn's avatar
Level 5

How about deleting vendor/compiled.php manually?

3 likes
thomasjsn's avatar

You are welcome. The php artisan clear-compiled command had to be run before the framework was updated. That why it didn't work and you had to delete vendor/compiled.php manually.

I use a tiny update script to make sure I do not forget:

php artisan down
php artisan clear-compiled
composer update --no-dev
php artisan optimize
php artisan up

Edit: Make sure you run php artisan optimize after the update to rebuild compiled.php.

7 likes
craigwebster's avatar

I got this too after running a composer update today. Where is compiled.php ?

craigwebster's avatar

I think there is something wierd with laravel 5.0.20, I reset my composer.json to 5.0.18 and ran a composer update and everything went through ok.

thomasjsn's avatar

Laravel 5.0.20 is not weird. You app is class optimized for 5.0.18 and that causes an issue with 5.0.20.

Delete vendor/compiled.php and run composer update again. And php artisan optimize after the update to rebuild compiled.php

1 like
ChrisCampbell's avatar

I was just having the same issue, I asked in the laravel IRC and simonerich suggested that i check my php version is not < 5.6, i was using 5.4 so i updated to 5.6 and now the issue is gone. Make sure you have the latest version of PHP :)

wolfkain's avatar

I have the same problem after today's composer update. I'm on Forge with the latest PHP 5.6.

I also tried to delete vendor/compiled.php and run php artisan optimize but I get the same message. Clearly this must be an issue with the latest version of laravel.

2 likes
mybigman's avatar

@wolfkain

Check to see if you have storage/framework/compiled.php and remove that.

Note. mine works perfectly fine on php 5.5

2 likes
robertdevs's avatar

thx am rename storage/framework/compiled.php fixed it!

binalfew's avatar

@hebron I did as you indicated in the script and the update was successful but the vendor/compiled.php file was not created, any ideas?

jeremyb's avatar

@binalfew the vendor/compiled.php was also not created for me, I had to run php artisan optimize --force

devluis's avatar

thanks @hebron ! I following yours answer and all works perfect! , First Delete vendor/compiled.php and after run composer update.

Dario's avatar

I have the same issue. I have the Laravel 5.1.15 and I do not find any vendor/compiled.php neither storage/framework/compiled.php.

My Laravel vendor folder is empty. What's next, please?

Dario's avatar

I was getting the error only when I tried to replace the Illuminate Auth service provider with the LDAP service provider. Then I removed the change and it's working again. But I noticed that the vendor folder miss the laravel framework. So I tried to run composer update but nothing changed. I searched for composer.php in vendor and storage but there is no composer.php. Then, I tried to run composer require laravel/laravel or laravel/framework but I got the following error:

Problem 1 - The requested package laravel/laravel could not be found in any version, there may be a typo in the package name. Problem 2 - The requested package laravel/laravel could not be found in any version, there may be a typo in the package name.

Potential causes:

  • A typo in the package name
  • The package is not available in a stable-enough version according to your minimum-stability setting

I ì'm using PSR-4 standards.

Dario's avatar

I just came up with the laravel installation. Deleted composer.lock and composer install did the job. Then, I'm still getting error with the Gate contract. **[Illuminate\Contracts\Container\BindingResolutionException]
Target [Illuminate\Contracts\Auth\Access\Gate] is not instantiable. **

Dario's avatar

Ok, solved. If using the ldap package Ccovey\LdapAuth, you might not replace the Illuminate\Auth\AuthServiceProvider as stated in the documentation since that instantiates the Gate contract but just append the service provider to the app config file providers array at the end. That solved my issue. Hope it could help others using this package on L5.

UnknownEntity's avatar

illuminate/contracts (v5.1.22) had caused my problems. I removed it and all works like a charm again.

donpuerto's avatar

@wolfkain hey mate it seems that you already resolve the issue on installing laravel on VM. Same problem with. How do you resolve it? Thanks

Please or to participate in this conversation.