3

After familiar with Codeigniter, I stared to learn Laravel.

I able to install Laravel using following command.

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

It works fine. :-)


Next I tried to setup sample Laravel project. I found a sample project from here (https://github.com/evercode1/sample-project).

What I did is I just download it and copied all folders to Xampp htdocs folder.

Then I visit the "http://localhost/sample-project-master/public/".

It gives following error.

Warning: require(D:\xampp\htdocs\sample-project-master\bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in D:\xampp\htdocs\sample-project-master\bootstrap\autoload.php on line 17

Fatal error: require(): Failed opening required 'D:\xampp\htdocs\sample-project-master\bootstrap/../vendor/autoload.php' (include_path='D:\xampp\php\PEAR') in D:\xampp\htdocs\sample-project-master\bootstrap\autoload.php on line 17

Have I done mistake when setting up already available Laravel project? How I correct following errors or what is the way to import Laravel project?

Karl Hill
  • 12,937
  • 5
  • 58
  • 95

6 Answers6

4

You should do:
1) Install composer dependencies

composer install

2) An application key need to be generated with the command

php artisan key:generate

3) Open Project in a Code Editor, rename .env.example to .env and modify DB name, username, password to your environment.

4) Migrate the database along with seed

php artisan migrate --seed

5) Now run the artisan serve command

php artisan serve
Sreejith BS
  • 1,183
  • 1
  • 9
  • 18
1

You should try this

composer install

OR

composer update --no-scripts 
composer update

For more details please follow this link.

halfer
  • 19,824
  • 17
  • 99
  • 186
AddWeb Solution Pvt Ltd
  • 21,025
  • 5
  • 26
  • 57
  • I have already install it. I think that that's why I able to create new project using `composer create-project --prefer-dist laravel/laravel blog`. Am I correct or am I understand your answer incorrectly? –  Aug 21 '17 at 07:10
  • Ohhh... that means should I run` composer update --no-scripts` for each each project? I thought I have to run that command just only one time. –  Aug 21 '17 at 07:14
  • @DaviddeSilva OR you should run command `composer dumpauto` and its work fine with me – AddWeb Solution Pvt Ltd Aug 21 '17 at 07:17
1
  1. the first error is due to not getting file path for bootstrap in bootstrap folder .
  2. you should run: composer install

3 . laravel requires vendor libraries which needs to be install , it does not come automatic with the package . because it's is git ignored . so you need to install it if needed.

Nahid Hasan
  • 687
  • 1
  • 10
  • 34
  • I have already install it. I think that that's why I able to create new project using composer create-project --prefer-dist laravel/laravel blog. Am I correct or am I understand your answer incorrectly? –  Aug 21 '17 at 07:12
  • Or should I run composer install for each each projects? –  Aug 21 '17 at 07:13
0

This means some dependencies are messing, Open your project root folder and run this command:

composer install 

or

php composer.phar install

I believe below command should work as I have tested on Windows and Linux:

composer update --no-scripts 

or if you already installed and updated the composer then check below command:

composer global update
RCode
  • 379
  • 3
  • 12
0

first You have to move the project to www(folder) or htdocs if using xamp or any folder that apache load the files from
then open ur terminal or cmd , and cd untill u reach prject folder , or u can do

shift + right click in the folder , a menu will come up choose "open command window here" .

then write this command composer update
this will install all the packages u need to run the project .

dont forget to modify .env file with your database information .
this should work .

Nasr
  • 65
  • 1
  • 12
0

You are facing this issue because your system might not have composer.laravel need dependency manager.you have to install the first composer to your htdoc folder.

You can install composer using following this command,composer installNow you can install laravel using (must run this command inside your htdoc)composer global require "laravel/installer"

Now you can create project usinglaravel new YOUR_PROJECT_NAME OR composer create-project --prefer-dist laravel/laravel YOUR_PROJECT_NAME

Note : it is good if you install composer and laravel on global location.

Documentation Available Here : https://laravel.com/docs/5.4/installation

Harshal Shah
  • 427
  • 3
  • 5