Laravel的Warning: require..../vendor/autoload.php錯誤的解決辦法

Laravel的Warning: require..../vendor/autoload.php錯誤的解決辦法

Laravel 作為PHP學習入門確實有點苦逼!但是為了所謂的藝術框架,我們只好忍了……

Git或者Composer拖下laravel示例程序代碼后一般會報以下錯誤的。


Warning: require(D:\www\laravel-canvas\bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in D:\www\laravel-canvas\bootstrap\autoload.php on line 17


Fatal error: require(): Failed opening required 'D:\www\laravel-canvas\bootstrap/../vendor/autoload.php' (include_path='\xampp\php\PEAR') in D:\var\laravel-canvas\bootstrap\autoload.php on line 17


顯然,這是核心都沒有拖下來的緣故!

解決辦法:

1. cd 到該引用的根目錄,刪除 composer.lock 文件;

2. 重新在根目錄執行“composer install”,這樣就能重新生成 composer.lock 文件了。

如果出現php版本不匹配,可用“composer install --ignore-platform-reqs”(忽略版本匹配)。


靜等它執行吧……

D:\var\laravel-canvas>composer install --ignore-platform-reqs
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 91 installs, 0 updates, 0 removals
  - Installing kylekatarnls/update-helper (1.2.0): Loading from cache
  - Installing doctrine/lexer (1.1.0): Downloading (100%)
  - Installing doctrine/annotations (v1.7.0): Downloading (100%)
 ....
 ....
 ....

 

(全文完)


6
25选5走势图