Laravel problem with php Artisan serves

Asked

Viewed 2,671 times

1

I am following a class of Laravel 5.6, and during the class, I created the project in Aravel, already with all the tools installed. NPM, Composer, Xampp etc.

So I turned the remote:

composer create-project --prefer-dist laravel/laravel projeto

I did all the procedure of the class, and tested the project using the web server with the command:

php artisan serve

I joined the project and everything went well. Soon after, I did the git push, versioning my project. This class was attended and tested at home.

The next day, I wanted to continue the class of where I stopped, however, from my work, and no longer from home.

I did the git clone, and tried to start the project again with the command:

php artisan serve

And introduced me to the mistake:

PHP Warning: require(C: Users Mazola Downloads Udemy-Laravel-Rotas/vendor/Autol oad.php): failed to open stream: No such file or directory in C: Users Mazola Do wnloads Udemy-Laravel-Rotas Artisan on line 18

Warning: require(C: Users Mazola Downloads Udemy-Laravel-Rotas/vendor/autoload.p hp): failed to open stream: No such file or directory in C: Users Mazola Downloa ds Udemy-Laravel-Rotas Artisan on line 18 PHP Fatal error: require(): Failed Opening required 'C:Users Mazola Downloads Udemy-Laravel-Rotas/vendor/autoload.php' (include_path='C: xampp php PEAR') in C : Users Mazola Downloads Udemy-Laravel-Rotas Artisan on line 18

Fatal error: require(): Failed Opening required 'C: Users Mazola Downloads Udemy -Laravel-Rotas/vendor/autoload.php' (include_path='C: xampp php PEAR') in C: Use rs Mazola Downloads Udemy-Laravel-Rotas Artisan on line 18

Not satisfied, I did several researches, and ended up finding some "solutions"

One of them was to rotate the command:

composer update

I circled, and gave again the php artisan serve. And I was testing in the browser accessing localhost:8000

This time it accessed, and started the server, however, when I finished the page presented me an error page:

500 Whoops, Something Went Wrong on our Servers.

It’s worth noting that after I upload the project in git and clone it again, the file .env was no longer available, only the .env.examples.

So I went into the archive .env.examples and "saved how" by naming the same for .env, and tried to start again, and ended up entering without problems, on the routes I had already set up in class, without any error.

I do not know what procedure to do to start the project in the correct and standardized way, this procedure I did to work is the standard used in the market?

  • 3

    You need to do the composer install to install the dependencies. The composer update will update the dependencies, which may break your code. The file .env, by default, is ignored by git

  • I did the Composer install, and still the error remained, after giving the start of the project : "500 Whoops, Something Went Wrong on our Servers" How to solve this problem, without having to open .env.examples and save as . env, have any idea?

  • You held the command php artisan key:generate?

1 answer

-3

Define what is this "standard used in the market". Usually to have Laravel on your machine,check if the Composer is installed so it gives the command to start the project with the framework. Stay tuned when cloning projects, check if any files are missing or there is a versioning problem

In case you need more details: https://laravel.com/docs/5.7/installation

Browser other questions tagged

You are not signed in. Login or sign up in order to post.