I\'m trying to install Laravel using Composer, but after running the following command
composer create-project laravel/laravel cmsLaravel 5.2
Follow the steps below;
Go inside the folder C:\xampp\htdocs>
(if you are using xampp) or C:\wamp\www>
(if you are using wamp) and open cmd/PoweShell & run the following commands:
composer global require "laravel/installer"
composer create-project laravel/laravel
(after running this command a folder having name Laravel will be created there) php artisan serve
command.After executing the last cmd
, it will show an URL: http://127.0.0.1:8000
; access the URL in a browser, which should reflect the will see the default webpage of Laravel.
Check your index.php and Change the path as per your project directory
Register The Auto Loader
require __DIR__.'/cmsLaravel /vendor/autoload.php';
$app =require_once __DIR__.'/cmsLaravel /bootstrap/app.php';
Change your command to this:
composer create-project laravel/laravel cmsLaravel 5.2.*
This mean any sub version of laravel 5.2
.
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.
After enabling the required extension(s), do remember to restart your server, then run the following command:
composer update
You can just run
composer install
and it will process the required files to load the laravel in web browser
EDIT:
After seeing your comment, you should go to your laravel directory in your cmd.
cd C:\xampp\htdocs\laravelCMS
and run the command
composer install
composer create-project laravel/laravel 6.0
composer is a tool for dependency management in PHP
create-project is command to create a new laravel project
laravel/laravel is for the skeleton application you get when creating a new project. It provides a default structure that's recommended (you're not forced to use it). The repository contains default config files, controllers, routes, etc. As well as code responsible for bootstrapping the application.
Link Laravel/laravel
6.0 Version in laravel