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

onurzdgn's avatar

Laravel crash no reason

Hi everyone, I am using Laravel 11 and my computer is 2019 MacBook Pro with Intel i9 chip, I am using MAMP for MySQL. Sometimes Laravel is crashing without no reason. I was find a way however it is not a good way, I delete vendor file and again run composer install command. This is error page:


Warning: require(/Users/onurozdogan/Documents/GitHub/sigma/vendor/composer/../symfony/deprecation-contracts/function.php): Failed to open stream: No such file or directory in /Users/onurozdogan/Documents/GitHub/sigma/vendor/composer/autoload_real.php on line 41

Fatal error: Uncaught Error: Failed opening required '/Users/onurozdogan/Documents/GitHub/sigma/vendor/composer/../symfony/deprecation-contracts/function.php' (include_path='.:/usr/local/Cellar/php/8.3.7/share/php/pear') in /Users/onurozdogan/Documents/GitHub/sigma/vendor/composer/autoload_real.php:41 Stack trace: #0 /Users/onurozdogan/Documents/GitHub/sigma/vendor/composer/autoload_real.php(45): {closure}('6e3fae29631ef28...', '/Users/onurozdo...') #1 /Users/onurozdogan/Documents/GitHub/sigma/vendor/autoload.php(25): ComposerAutoloaderInite61a9e00bbb47903e2f49a08bafe4ecb::getLoader() #2 /Users/onurozdogan/Documents/GitHub/sigma/public/index.php(13): require('/Users/onurozdo...') #3 /Users/onurozdogan/Documents/GitHub/sigma/vendor/laravel/framework/src/Illuminate/Foundation/resources/server.php(23): require_once('/Users/onurozdo...') #4 {main} thrown in /Users/onurozdogan/Documents/GitHub/sigma/vendor/composer/autoload_real.php on line 41

Why this is happening? And what can I do?

0 likes
5 replies
richardhulbert's avatar

HI @onurzdgn

So the first think I would do is to open up the terminal and look to see if the file system can see that file. If files re disappearing mysteriously from your drive it might be about to fail or be very fragmented. if all seems fine I would make sure that composer is up to date and working.

What version of PHP are you running? How are you accessing the site Valet / Homestead / Herd ?

onurzdgn's avatar

@richardhulbert My php version 8.3.7. I can't use anything just run MAMP for MySQL then php artisan serve and open in browser. It happend in Laravel 10 just 1 or 2 times, but in Laravel 11 it happens sometimes but frequently.

iamgeorge's avatar

2019 MacBook Pro with Intel i9 chip... which OS is installed?

// Step 1: Clear Composer Cache // Sometimes, issues with Composer dependencies can arise from corrupted cache files. Clearing the cache ensures that Composer fetches fresh copies of the dependencies. composer clear-cache

// Step 2: Remove Vendor Directory and Reinstall Dependencies // Deleting the 'vendor' directory and then running 'composer install' forces Composer to re-download all dependencies. This can resolve issues related to missing or corrupt files. rm -rf vendor composer install

// Step 3: Check composer.json and composer.lock // Ensure that the 'composer.json' and 'composer.lock' files are consistent. If necessary, delete 'composer.lock' and run 'composer update' to regenerate it. This helps to resolve discrepancies between the specified and installed versions of packages. composer update

// Step 4: Verify Package Versions // Check if there are any version conflicts or issues with the 'symfony/deprecation-contracts' package or other dependencies. Use 'composer why-not' to identify possible conflicts. composer why-not symfony/deprecation-contracts

// Step 5: Check for Disk Space // Ensure that there is sufficient disk space available on your system. Lack of disk space can sometimes prevent files from being written correctly. df -h

// Step 6: Verify File Permissions // Ensure that the permissions for the 'vendor' directory and its contents are set correctly. Incorrect permissions might prevent files from being read or written properly. sudo chown -R $(whoami) vendor

// Step 7: Update Composer // Keeping Composer up-to-date can resolve issues related to bugs or compatibility problems. Run 'composer self-update' to ensure you are using the latest version. composer self-update

// Step 8: Check PHP Configuration // Ensure that your PHP version and configuration are compatible with Laravel 11. Laravel 11 requires PHP 8.1 or higher. Verify your PHP version with 'php -v' and check the configuration if necessary. php -v

// Step 9: Review Laravel and PHP Error Logs // Check Laravel's log files located in 'storage/logs/' and the PHP error log for any additional information or errors that might provide insight into the issue. cat storage/logs/laravel.log cat /path/to/php/error.log

// Step 10: Update Dependencies // Updating all dependencies to their latest versions can help resolve issues with outdated or incompatible packages. Use 'composer update --with-dependencies' to ensure all related packages are updated. composer update --with-dependencies

1 like
Snapey's avatar

Once it starts showing this error, does it keep showing it until you take action?

Seeing more of the error might show where in your code it is crashing.

The error seems to be related to handling deprecation notices, which might indicate you have some code which is not php8.3 ready.

Please or to participate in this conversation.