-1

Would you please help me to find out my installation problem of Laravel. I installed composer then installed laravel. When i try to run the project through php artisan serve, it gives following error.

Warning: require(/opt/lampp/htdocs/laravel_project/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /opt/lampp/htdocs/laravel_project/bootstrap/autoload.php on line 17

Fatal error: require(): Failed opening required '/opt/lampp/htdocs/laravel_project/bootstrap/../vendor/autoload.php' (include_path='.:/opt/lampp/lib/php') in /opt/lampp/htdocs/laravel_project/bootstrap/autoload.php on line 17

I mention some things that the installed laravel folder contains totalling 120 items and total size 651kb. inside the projct directory, there is no folder named vendor. i'm using ubuntu 16.

user7421798
  • 103
  • 11
  • 3
    Did you run `composer install` first? Installing composer installs the package manager. But composer install downloads application dependencies including the laravel project, and compiles them. – Gravy Mar 19 '17 at 18:49
  • yes i runned composer install but still didn't work. – user7421798 Mar 19 '17 at 19:39
  • Make sure your composer is successfully updated. May be it is not, that's why autoload.php is not there, and ensure your path when you try to execute php artisan serve. @user7421798 – Rahul Chauhan Mar 19 '17 at 19:43
  • i runned **sudo composer install**. now there is no error shown but home page is fully blank. there is no text named "LARAVEL" – user7421798 Mar 20 '17 at 05:25

2 Answers2

1

If vendor folder is present in your directory, try this command. It may help you.

cp .env.example .env
php artisan key:generate
kazinayem2011
  • 348
  • 6
  • 20
0

As per @Gravy mentions in the comments, you need to run composer install in order to generate the autoload.php file.

Spholt
  • 3,724
  • 1
  • 18
  • 29
  • i also installed composer to root of my project directory but still didn't create vendor folder and gets error – user7421798 Mar 19 '17 at 19:38
  • It's confirmed that your composer is not successfully install, otherwise vendor is there. Try to watch out composer install process. – Rahul Chauhan Mar 19 '17 at 19:46