添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Referente ao curso Laravel: facilitando o desenvolvimento PHP , no capítulo Novo projeto com Laravel e atividade Executando o Laravel com ajuda do Artisan

Bom noite,

Estou com um erro quando executo o comando php artisan serve no cmd(Na raiz do projeto), segue abaixo:

PHP Warning:  require(C:\Users\Hugo\Desktop\Alura\PHP\Laravel\estoque\bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in C:\Users\Hugo\Desktop\Alura\PHP\Laravel\estoque\bootstrap\autoload.php on line 17
Warning: require(C:\Users\Hugo\Desktop\Alura\PHP\Laravel\estoque\bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in C:\Users\Hugo\Desktop\Alura\PHP\Laravel\estoque\bootstrap\autoload.php on line 17
PHP Fatal error:  require(): Failed opening required 'C:\Users\Hugo\Desktop\Alura\PHP\Laravel\estoque\bootstrap/../vendor/autoload.php' (include_path='.;C:\php\pear') in C:\Users\Hugo\Desktop\Alura\PHP\Laravel\estoque\bootstrap\autoload.php on line 17
Fatal error: require(): Failed opening required 'C:\Users\Hugo\Desktop\Alura\PHP\Laravel\estoque\bootstrap/../vendor/autoload.php' (include_path='.;C:\php\pear') in C:\Users\Hugo\Desktop\Alura\PHP\Laravel\estoque\bootstrap\autoload.php on line 17

Vi em um outro tópico o mesmo problema porém a solução desse tópico não resolveu pra mim (https://cursos.alura.com.br/forum/topico-duvida-no-ex-3-da-aula-1-novo-projeto-com-laravel-19701).

Estou usando windows 10.

tente rodar o comando abaixo dentro da raiz do projeto.

composer dump-autoload

depois disso, tente executar o comando

php artisan serve

Veja se resolve e nos de um retorno aqui.

Tarcísio,

Executei o comando que vc sugeriu, e o erro mudou agora, segue abaixo:

PHP Fatal error:  Uncaught Error: Class 'Illuminate\Foundation\Application' not found in C:\Users\Hugo\Desktop\Alura\PHP\Laravel\estoque\bootstrap\app.php:14
Stack trace:
#0 C:\Users\Hugo\Desktop\Alura\PHP\Laravel\estoque\artisan(18): require_once()
#1 {main}
  thrown in C:\Users\Hugo\Desktop\Alura\PHP\Laravel\estoque\bootstrap\app.php on line 14
Fatal error: Uncaught Error: Class 'Illuminate\Foundation\Application' not found in C:\Users\Hugo\Desktop\Alura\PHP\Laravel\estoque\bootstrap\app.php:14
Stack trace:
#0 C:\Users\Hugo\Desktop\Alura\PHP\Laravel\estoque\artisan(18): require_once()
#1 {main}
  thrown in C:\Users\Hugo\Desktop\Alura\PHP\Laravel\estoque\bootstrap\app.php on line 14

O que pode ser?

Obrigado pela ajuda.

Ta parecendo que ta faltando pedaços do seu laravel. Como se não tivesse feito o download de todas as partes.

Execute o comando abaixo e de um retorno aqui.

composer update

e depois

php artisan serve

Tarcísio,

Executei e apareceu o seguinte:

Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages.

Problem 1 - laravel/framework v5.0.9 requires ext-mbstring -> the requested PHP extension mbstring is missing from your system. - laravel/framework v5.0.8 requires ext-mbstring -> the requested PHP extension mbstring is missing from your system. - laravel/framework v5.0.7 requires ext-mbstring -> the requested PHP extension mbstring is missing from your system. - laravel/framework v5.0.6 requires ext-mbstring -> the requested PHP extension mbstring is missing from your system. - laravel/framework v5.0.5 requires ext-mbstring -> the requested PHP extension mbstring is missing from your system. - laravel/framework v5.0.4 requires ext-mbstring -> the requested PHP extension mbstring is missing from your system. - laravel/framework v5.0.35 requires ext-mbstring -> the requested PHP extension mbstring is missing from your system. - laravel/framework v5.0.34 requires ext-mbstring -> the requested PHP extension mbstring is missing from your system. - laravel/framework v5.0.33 requires ext-mbstring -> the requested PHP extension mbstring is missing from your system. - laravel/framework v5.0.32 requires ext-mbstring -> the requested PHP extension mbstring is missing from your system. - laravel/framework v5.0.31 requires ext-mbstring -> the requested PHP extension mbstring is missing from your system. - laravel/framework v5.0.3 requires ext-mbstring -> the requested PHP extension mbstring is missing from your system. - laravel/framework v5.0.29 requires ext-mbstring -> the requested PHP extension mbstring is missing from your system. - laravel/framework v5.0.28 requires ext-mbstring -> the requested PHP extension mbstring is missing from your system. - laravel/framework v5.0.27 requires ext-mbstring -> the requested PHP extension mbstring is missing from your system. - laravel/framework v5.0.26 requires ext-mbstring -> the requested PHP extension mbstring is missing from your system. - laravel/framework v5.0.25 requires ext-mbstring -> the requested PHP extension mbstring is missing from your system. - laravel/framework v5.0.24 requires ext-mbstring -> the requested PHP extension mbstring is missing from your system. - laravel/framework v5.0.23 requires ext-mbstring -> the requested PHP extension mbstring is missing from your system. - laravel/framework v5.0.22 requires ext-mbstring -> the requested PHP extension mbstring is missing from your system. - laravel/framework v5.0.21 requires ext-mbstring -> the requested PHP extension mbstring is missing from your system. - laravel/framework v5.0.20 requires ext-mbstring -> the requested PHP extension mbstring is missing from your system. - laravel/framework v5.0.2 requires ext-mbstring -> the requested PHP extension mbstring is missing from your system. - laravel/framework v5.0.19 requires ext-mbstring -> the requested PHP extension mbstring is missing from your system. - laravel/framework v5.0.18 requires ext-mbstring -> the requested PHP extension mbstring is missing from your system. - laravel/framework v5.0.17 requires ext-mbstring -> the requested PHP extension mbstring is missing from your system. - laravel/framework v5.0.16 requires ext-mbstring -> the requested PHP extension mbstring is missing from your system. - laravel/framework v5.0.15 requires ext-mbstring -> the requested PHP extension mbstring is missing from your system. - laravel/framework v5.0.14 requires ext-mbstring -> the requested PHP extension mbstring is missing from your system. - laravel/framework v5.0.13 requires ext-mbstring -> the requested PHP extension mbstring is missing from your system. - laravel/framework v5.0.12 requires ext-mbstring -> the requested PHP extension mbstring is missing from your system. - laravel/framework v5.0.11 requires ext-mbstring -> the requested PHP extension mbstring is missing from your system. - laravel/framework v5.0.10 requires ext-mbstring -> the requested PHP extension mbstring is missing from your system. - laravel/framework v5.0.1 requires ext-mbstring -> the requested PHP extension mbstring is missing from your system. - laravel/framework v5.0.0 requires ext-mbstring -> the requested PHP extension mbstring is missing from your system. - laravel/framework 5.0.30 requires ext-mbstring -> the requested PHP extension mbstring is missing from your system. - Installation request for laravel/framework 5.0.* -> satisfiable by laravel/framework[5.0.30, v5.0.0, v5.0.1, v5.0.10, v5.0.11, v5.0.12, v5.0.13, v5.0.14, v5.0.15, v5.0.16, v5.0.17, v5.0.18, v5.0.19, v5.0.2, v5.0.20, v5.0.21, v5.0.22, v5.0.23, v5.0.24, v5.0.25, v5.0.26, v5.0.27, v5.0.28, v5.0.29, v5.0.3, v5.0.31, v5.0.32, v5.0.33, v5.0.34, v5.0.35, v5.0.4, v5.0.5, v5.0.6, v5.0.7, v5.0.8, v5.0.9].

To enable extensions, verify that they are enabled in your .ini files: - C:\php\php.ini You can also run php --ini inside terminal to see which files are used by PHP in CLI mode.

Hummm...Saquei...a extensão mbstring também desativada no seu php. Me parece que é um requisito pro laravel instalar. Se tiver no ubuntu executa o comando abaixo pra instalar.

sudo apt-get install php-mbstring

Se tiver no Windows. Abra o arquivo php.ini e procure a linha onde o mbstring está, retire o ; do inicio dela e salve o arquivo.

Execute novamente os comandos na raiz do projeto

composer update
php artisan serve

Ola Tarcísio,

Consegui resolver com a sua sugestão. Tinha que descomentar a linha onde tinha o mbstring no arquivo php.ini

Vlw mesmo, obg!