You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

执行php artisan serve报错:require无法打开vendor/autoload.php文件

Fix for "vendor/autoload.php not found" when running php artisan serve

Hey there! That error you're seeing is super common when a Laravel project's dependencies haven't been fully installed yet. Let's break down what's going on and how to fix it:

Why this happens

The vendor/autoload.php file is generated by Composer when it installs all your project's required dependencies (like Laravel's core files, third-party packages, etc.). If this file is missing, it means either:

  • The laravel new command didn't finish pulling in dependencies (maybe due to network issues or a process interruption)
  • You created the project manually (like downloading a zip) instead of using Composer, so dependencies weren't installed automatically
  • The vendor directory was accidentally deleted

How to fix it

Follow these steps:

  1. Open your command line (CMD or PowerShell) and navigate to your project's root directory:
    cd C:\Users\Teacher\Desktop\davranbek\rand
    
  2. Run the Composer install command to pull in all dependencies and generate the missing vendor directory + autoload file:
    composer install
    
  3. If you run into slow download speeds or network errors while running the command, you can switch to a domestic Composer mirror first (for faster access):
    composer config -g repo.packagist composer https://packagist.phpcomposer.com
    
    Then re-run composer install.

Once the command finishes successfully, try running php artisan serve again—it should work without that error now!

If you still run into issues, double-check that your Composer version (1.6.5) is compatible with your Laravel version. Since you're using PHP 7.0.30, you're likely running Laravel 5.5-5.8, which works perfectly with Composer 1.6.5.

内容的提问来源于stack exchange,提问作者Davranbek Rozmetov

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.29 07:02:15