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

Dosmukhanbet's avatar

Having issues after upgrading to laravel 12

Hi, Can anyone suggest how to solve the problem below, it appears after upgrading to laravel 12 from 11, on the application page and also when running any command in terminal. composer dump-autoload not helping.

Warning: require(/Users/dos/Desktop/code/ship/vendor/composer/../laravel/framework/src/Illuminate/Collections/functions.php): Failed to open stream: No such file or directory in /Users/dos/Desktop/code/ship/vendor/composer/autoload_real.php on line 39

Fatal error: Uncaught Error: Failed opening required '/Users/dos/Desktop/code/ship/vendor/composer/../laravel/framework/src/Illuminate/Collections/functions.php' (include_path='.:') in /Users/dos/Desktop/code/ship/vendor/composer/autoload_real.php:39 Stack trace: #0 /Users/dos/Desktop/code/ship/vendor/composer/autoload_real.php(43): {closure}('476ca15b8d69b04...', '/Users/dos/Desk...') #1 /Users/dos/Desktop/code/ship/vendor/autoload.php(25): ComposerAutoloaderInitecee385275a32a93bf8d0d688f5cbd04::getLoader() #2 /Users/dos/Desktop/code/ship/public/index.php(13): require('/Users/dos/Desk...') #3 /Applications/Herd.app/Contents/Resources/valet/server.php(167): require('/Users/dos/Desk...') #4 {main} thrown in /Users/dos/Desktop/code/ship/vendor/composer/autoload_real.php on line 39


0 likes
13 replies
Merklin's avatar

What is on line 39 in /Users/dos/Desktop/code/ship/vendor/composer/autoload_real.php and what are the composer and PHP versions?

1 like
Dosmukhanbet's avatar

@Merklin

 $requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
            if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
                $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

                require $file;
            }
Dosmukhanbet's avatar

@Merklin

Here's how the autoload_real.php file referenced by the error looks like, I'd appreciate it if you have any ideas on how to solve the issue

jlrdw's avatar

You went through the upgrade guide first?

1 like
Dosmukhanbet's avatar

@jlrdw yes I did, updated dependencies at composer.json and Laravel Installer as per the guide.

jlrdw's avatar

@Dosmukhanbet I never seen a path like that, but try deleting the vendor folder, update composer to latest version:

composer self-update

then

composer clear-cache

then rename the composer.lock file

then try to run

composer install

again.

Also double check you didn't miss anything in the upgrade guide:

https://laravel.com/docs/12.x/upgrade

1 like
kggeorgiev's avatar

Hi, check if functions.php exists in your /Users/dos/Desktop/code/ship/vendor/laravel/framework/src/Illuminate/Collections directory. It is part of the framework and if it has been accidentally deleted it is causing your application to crash

1 like
Dosmukhanbet's avatar

@kggeorgiev You are right, the src folder in the /vendor/laravel/framework/ directory is missing at all. Can you please advise me how I can reinstall laravel 12 if running any composer command returns an error?

maxxd's avatar

Try running composer dump-autoload then composer install

1 like

Please or to participate in this conversation.