Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install Laravel using Composer

I'm trying to install Laravel using Composer, but after running the following command

composer create-project laravel/laravel cmsLaravel 5.2

pointing to my c/xampp/htddocs directory, I get the error below:

C:\xampp\htdocs\laravelCMS\bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in C:\xampp\htdocs\laravelCMS\bootstrap\autoload.php on line 17

like image 576
FahadAkram Avatar asked Feb 01 '17 08:02

FahadAkram


1 Answers

To install Laravel using composer, all you need to do is to run in your terminal is:

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

Where: blog is the name of the folder containing your new Laravel instance.

To install Laravel directly within your chosen directory (not in a folder within it as demonstrated above), simply run the same command but this time without a folder name as in:

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

Remember to run the command within your desired directory for the project; in your case, for C:\xampp\htdocs\, then, run either the first or second command as above base on your needs.

This assumes you already have Composer properly installed as recommended on their website.

Before you try addressing your failed to open stream: error, do avoid having folder names with space(s) as in your command above (obviously not the source of the error).

Make sure you have the correct Server Requirements for Laravel
the failed to open stream: error usually occur when the OpenSSL PHP Extension not enabled.

  • PHP >= 5.6.4
  • OpenSSL PHP Extension
  • PDO PHP Extension
  • Mbstring PHP Extension
  • Tokenizer PHP Extension
  • XML PHP Extension

After enabling the required extension(s), do remember to restart your server, then run the following command:

composer update
like image 98
nyedidikeke Avatar answered Oct 17 '22 02:10

nyedidikeke