dongxibeng5324 2018-05-31 20:28
浏览 300

php artisan服务找不到autoload.php

SOLUTION: laravel new project-name was actually giving me an error that i overlooked. I had the wrong version of php. It requires phpv7.1.3 or higher. If you don't have it it doesn't work.

Ran into one other problem:

  • i had a system environment variable that is pointing to an old version of php
  • Also laravel requires openssl extension and mbstring to turned on. UNCOMMENTED from php.ini

FOR NEWCOMERS: if you have just downloaded php and unzipped the file. It contains a file called

install.txt

that you HAVE to read. It explains everything.

I ran laravel new blog from their getting started page. When I tried to run php artisan serve, I got the following error:

Warning: require(C:\Projects\laravel-projects\blog/vendor/autoload.php): failed to open stream: No such file or directory in C:\Projects\laravel-projects\blog\artisan on line 18

The artisan file is pointing to

require __DIR__.'/vendor/autoload.php';

this directory does not exist. Even if I point it to the correct directory, it still wouldn't work because I don't have read permissions for that folder (so it gets denied).

What's going on, and how can I fix this?

EDIT: changed the url from the mentioned above to:

C:\Users\sarkis\AppData\Roaming\Composer\vendor\autoload.php

This worked perfectly for some reason. And NOW. A NEW ERROR HAS APPEARED.

Fatal error: Uncaught Error: Class 'Illuminate\Foundation\Application' not found in C:\Projects\laravel-projects\blog\bootstrap\app.php:14 Stack trace:#0 C:\Projects\laravel-projects\blog\artisan(21): require_once() #1 {main} thrown in C:\Projects\laravel-projects\blog\bootstrap\app.php on line 14

found that i don't have the proper version of php required.

  • 写回答

6条回答 默认 最新

  • dongpan8439 2018-05-31 20:30
    关注

    Try running composer dump-autoload , after that run a composer install

    If that doesn't work, try the composer update --no-scripts

    评论

报告相同问题?

悬赏问题

  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥15 stable diffusion
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘