Laravel install in localhost - laravel

I am using windows 8 .I am using XAMPP.I installed XAMPP in D drive. My web root path is D:\php\htdocs. Location of php.exe file is D:\php\php. I would like to install Composer first then Laravel using composer. Could any one show me the whole process with step by step instruction ??

Add Php installation path to Environment Variable.
Cd to D:\xampp\php [Php Installation path]
Install composer using, php -r "readfile('https://getcomposer.org/installer');" | php
Create composer.bat file, using D:\xampp\php>echo #php "%~dp0composer.phar" %*>composer.bat
Check the installation using composer -V.
If it works fine, install laravel using the following command. composer create-project laravel/laravel myapp --prefer-dist

Download and run the Composer Windows Installer from here: https://getcomposer.org/download/
Go to web root directory D:\php\htdocs
Run composer create-project laravel/laravel myapp, this will install laravel project in D:\php\htdocs\myapp directory.

Related

How to install composer globally for laravel app in windows?

I have a question related to composer and laravel. My question is whenever I install the fresh laravel app using command :
composer create-project laravel/laravel blog
Inside my C://xampp/htdocs/ directory and then change path to C://xampp/htdocs/blog/, here I am unable to run the composer command but I had already installed composer from its official website globally in C://xampp/htdocs/ directory. So is there any way to use composer command globally whenever I install fresh laravel app, so that I don't want to install composer in the laravel app directory everytime.
Now I guess they provide direct setting up global installation,
Check here
I did it like this a lot earlier,
Change to the path (or you can add that directory to your path later), and run the installer as mentioned on composer download site to download composer.phar.
Create a new composer.bat file alongside composer.phar.
Using cmd.exe:
run
echo #php "%~dp0composer.phar" %*>composer.bat
Then set it to path environment variable(see this)
Test with a new terminal:
composer -V
Will return
Composer version 1.10.6 2020-05-06 10:28:10
go to composer website and download the exe file, you should have it gloablly if you install it that way.
Good luck ^_^

Laravel Setup Isshue and composer Isshue on windows

Not able to create new laravel project.
C:\Users\Devil>composer global require "laravel/installer"
Changed current directory to C:/Users/Devil/AppData/Roaming/Composer
[ErrorException]
file_put_contents(): Filename cannot be empty
global <command-name> [<args>]...
C:\Users\Devil>laravel new blog
'laravel' is not recognized as an internal or external command,
operable program or batch file.
Please Help Me on this
1 - Install composer. In case it is not yet installed here is the easiest way to install composer on windows
2 - Go to your folder where you save your projects through the command line and run this command: composer create-project --prefer-dist laravel/laravel project-name . This will create a new folder project-name
3 - Access the project-name folder through the command line and run php artisan serve
4 - Open your browser and access http://localhost:8000

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
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
Follow the steps below;
Download and install Composer.
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)
Now go inside Laravel folder and run 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.
Download and install composer
Run composer global require "laravel/installer"
Open terminal inside C:\xampp\htdocs and run laravel new my_folder_name
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
Change your command to this:
composer create-project laravel/laravel cmsLaravel 5.2.*
This mean any sub version of laravel 5.2.
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';
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
just run your command line as admin
it worked for me
Please follow this step and try it
step 1
composer create-project laravel/laravel example-app
step 2
composer global require laravel/installer
laravel new example-app
step 3
cd example-app
php artisan serve
Else I will Recommend You To Go in to laravel offical page
Clik Here

how to make php artisan command available?

I read previous posts here about same problem but they did not solve my problem. I am running wamp latest version on windows 7 and I cloned a laravel app from github then I ran composer install on the root folder of the app and all vendors installed. however I still can not execute php artisan list on the app root folder
I tried also this command
composer global require "laravel/installer=~1.1"
but same problem also there is no laravel folder installed inside vendor folder. I dont know what laravel version used with this web app
So how I can make php artisan work ?
Update:
I opened composer.json file and I found no Laravel frame work to install !! should I return to the developer who made this or I just add Laravel package to composer.json and run composer install again ? if so what I should add to the composer.json ? I dont know which version to install !!
Your project has to have an artisan file in the root directory, otherwise the php artisan command won't work.
I had a similar issue. Fixed it by using the following command, which results in a clean installation.
composer create-project --prefer-dist laravel/laravel my-project
If errors occur, your CLI will show them.
Docs

Getting Error in installation of yii2 advance template

I'm new to Yii2, I'm trying to install yii2 application advanced template.
I did follow these steps:
1 - Download yii2-app-advanced zip file from https://github.com/yiisoft/yii2-app-advanced
Follow GETTING STARTED guide:
My vendor directory Show Empty.
Please help, thanks in advance
Installing via Composer
If you do not already have Composer installed, you may do so by following the instructions at getcomposer.org. On Linux and Mac OS X, you'll run the following commands:
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
On Windows, you'll download and run Composer-Setup.exe.
Please refer to the Composer Documentation if you encounter any problems or want to learn more about Composer usage.
If you had Composer already installed before, make sure you use an up to date version. You can update Composer by running composer self-update.
With Composer installed, you can install Yii by running the following commands under a Web-accessible folder:
composer global require "fxp/composer-asset-plugin:~1.0.3"
composer create-project --prefer-dist yiisoft/yii2-app-advanced basic
The first command installs the composer asset plugin which allows managing bower and npm package dependencies through Composer. You only need to run this command once for all. The second command installs Yii in a directory named basic. You can choose a different directory name if you want.
Note: During the installation Composer may ask for your Github login credentials. This is normal because Composer needs to get enough API rate-limit to retrieve the dependent package information from Github. For more details, please refer to the Composer documentation.
composer create-project --prefer-dist --stability=dev yiisoft/yii2-app-advanced basic
Yii2 Installation Following command:
(1) First install Composer (LINUX):
Locally:
curl -sS https://getcomposer.org/installer | php
OR
(1) First install Composer (WINDOWS):
C:\Users\username>cd C:\bin
C:\bin>php -r "readfile('https://getcomposer.org/installer');" | php
Note: If the above fails due to readfile, use the http url or enable php_openssl.dll in php.ini
C:\bin>echo #php "%~dp0composer.phar" %>composer.bat*
C:\Users\username>composer -V
Composer version 27d8904
(2) Yii2 framework online downloads:
Basic App:
php composer.phar create-project yiisoft/yii2-app-basic basic 2.0.0-beta
Advanced App:
php composer.phar create-project yiisoft/yii2-app-advanced advanced 2.0.0-beta
(3) Other App Settings Command:
php init
php yii migrate
Refrence
use composer cos you need composer in future too!
and after unzip the advance project in www or htdocs you should navigate to your project with cmd or terminal and type yii migrate after that again type composer update

Resources