How to install Laravel via installer? - laravel

In Laravel documentation, it explained one short paragraph on how to use installer to install Laravel.
First, download the Laravel installer PHAR archive. For convenience, rename the file to laravel and move it to /usr/local/bin. Once installed, the simple laravel new command will create a fresh Laravel installation in the directory you specify. For instance, laravel new blog would create a directory named blog containing a fresh Laravel installation with all dependencies installed. This method of installation is much faster than installing via Composer.
I am a Windows 7 user. After download the laravel.phar file, where should I store the file? I don't think there is any /usr/local/bin directory on Windows 7. How can I get the laravel command to be able to use in command window?

Install laravel 5.2 via Laravel Installer in windows 7
Steps:
Please make sure you have installed composer into your computer
Open command prompt
$ composer global require “laravel/installer”
C:\xampp\htdocs> laravel new mylaravel
Youtube video guide:
http://www.pranms.com/how-to-install-laravel-5-2-via-laravel-installer-in-windows-7/

The laravel installer needs to be in your PATH (no matter which Operating system).
In Unix based systems, /usr/local/bin is in your PATH by default.
On Windows, you can add a folder to your PATH by doing like this:
Start the System Control Panel applet (Start - Settings - Control Panel - System).
Select the Advanced tab.
Click the Environment Variables button.
Under System Variables, select Path, then click Edit.
From http://windowsitpro.com/systems-management/how-can-i-add-new-folder-my-system-path

It's a lot easier to install using Composer. Download the Windows Composer installer from the Composer Website and run it. Once it's installed you can run from the command line:
composer create-project laravel/laravel your-project-name
This will create the folder your-project-name and install Laravel in it. The advantage of using Composer it that it makes adding other packages to Laravel really easy.

Related

How to install two composer in one windows system?

How to install two composer in one windows system? (how to use difference composer in one windows system)
If you're using the windows installer only, IIRC you can't as it ships with the precondition to install under the canonical composer name.
However if you download the phar file, you just need to use the phar file of the version you would like to execute. This works independently to using the windows installer - both with and without it.
This has also the benefit that you can specify the PHP executable you would like to run composer.phar with.
c:\> c:\my\php.exe c:\my\composer-2.2.10.phar --version
This is basically what the Composer manual means where-ever it writes php composer.phar ....
You replace php with the PHP executable you would like to use and composer.phar with the composer phar you would like to use.
The windows setup installer is just installing the latest with the PHP version on your system under the canonical name composer. But instead you can create your own composer.bat.
You can then also create two such files for the different versions, e.g. composer-blue.bat and composer-red.bat.
This technique should be compatible to have next to composer with the windows setup installer, so you can use it to install one version you manage with the setup and zero up to N versions you manage yourself with the phar files.
Composer homepage lists all composer.phar files, see https://getcomposer.org/download/ and scroll down to "Manual Downloads" section.
A command-line utility like wget which also runs on Windows can greatly help you to streamline your process downloading the composer version of your choice under the file-name you'd like to have.
There is a Wikibook available on Windows Batch Scripting.
for window do the following steps:
one -> (create composer1 directory in C:\composer_path)
two -> (copy three file in composer directory to composer1 directory)
three -> (set path composer1 to environment variable)
four -> (run composer1 self-update --1 in cmd) because Convert to version 1.0.0
five -> (test versions composer)
and Done! ^_^
you can see two version of composer installed in one windows system.

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 ^_^

How to install mPDF with Composer in Plesk Obsidian

I would like to know how to install mPDF on a particular site hosted on a server with Plesk Obsidian running on CentOS 6.10 (Final).
I tried to open Php Composer but the only option I have is Find your Composer applications and there is no option to install new packages.
On the web I read that I should create a file named composer.json and put it in the project directory but I have no idea where to create the directory, how to call the directory and what to put inside this file!
Thanks for your help!

How to install Laravel via Laravel Installer on Windows?

I’m trying to install the Laravel Framework on Windows with the Laravel Installer method.
In the documentation I found the following:
First, download the Laravel installer using Composer. Make sure to
place the “~/.composer/vendor/bin” directory in your PATH so the
laravel executable is found when you run the laravel command in your
terminal.
Now this PATH does not look familiar to me. Could you tell me the working path for Windows?
BTW: I’m using WAMP. Composer is installed and updated.
The PATH for Windows:
I’ve found the location where composer stores the Vendor files.
So instead of ~/.composer/vendor/bin, on Windows the following path should be used:
C:\Users\<COMPUTER NAME>\AppData\Roaming\Composer\vendor\bin
How to install the Laravel Installer:
=======
I assume you have php and composer in your PATH already.
First of all install the Laravel Installer. Open a command prompt and enter:
composer global require "laravel/installer=~1.1"
**Then update the PATH environment variable** via e.g. command prompt with admin privileges:
set PATH=%PATH%;%USERPROFILE%\AppData\Roaming\Composer\vendor\bin
// setx /M path "%path%;%appdata%\Composer\vendor\bin" (this may destroy your system)
%appdata% is added, so you don’t have to worry about adding your computer name.
How to create a fresh Laravel Installation:
Now you should be able to run laravel commands in the command prompt.
To create a fresh laravel installation, open a command prompt in the directory of choice and enter:
laravel new name_of_directory
If everything went right, you should see the following message:
Crafting application...
Application ready! Build something amazing.
Use Laragon (http://laragon.org/)
Install Laragon.
Use Laragon Menu to create project
Take you 5 minutes to have Laravel4 o Laravel5.
Launch Laragon Project
Laragon automatically create Virtual host for your project name ( project_name.me)
Hope it helps.
Source: https://innopy.wordpress.com/2015/02/07/laravel-windows/
If you are having trouble using the command prompt, use the GUI approach:
The path in Windows is:
C:\Users\UserName\AppData\Roaming\Composer\vendor\bin
In the above path "UserName" is your user name that you are logged in your computer as. If you don't know your username, go here: http://library.queensu.ca/libguides/computers/windows-username-check.htm
Copy the above path, replace the "UserName" with your username.
Then go to your computer's environment variables. Here's how:
Right click on your Computer and go to properties
Go to Advanced system settings
Under Advanced Tab, Click on Environment Variables
Under User Variables, select Path and click Edit:
Put a semicolon at the end of the existing text and paste your path, example:C:\ProgramData\ComposerSetup\bin. Press OK ...
Restart your command prompt and type laravel and hit enter. If the path was successfully set, you will see "Laravel Installer Version ... "
How to install Laravel on Windows using WAMP
Install WAMP first.
I leave everything to default.
Enable OpenSSL and all required extensions in PHP.ini
After you installed WAMP, you need to do this. This is how you make sure OpenSSL is enabled:
On your right hand side of your taskbar, click WAMP and then choose PHP.ini.
And then find php_openssl, and then remove the semicolon in front of php_openssl.
And then, save. Close that file and now go to wamp manager again, and now enable OpenSSL there just to be safe.
After you do that, restart Wamp.
Install Composer
Go to https://getcomposer.org/ and download Windows installer.
The setup will ask for your PHP. if you install your WAMP in default setting, it will usually end up in C:\wamp\bin\php\php5.4.12.
If your installation is successful, by running composer on command prompt, you will see all kinds of info just by running that command.
If you can see it, that means your Composer installation is complete. Let’s move to the next one.
Make sure that your htppd.conf includes httpd-vhosts.conf
Now let’s make sure that your htppd.conf also includes httpd-vhosts.conf. This is beneficial if you want to make a pretty URL just like this one:
Instead of writing up localhost/mylaravel, it would be “nicer” to have that pretty URL, right?
Anyway, let’s go on.
Go to C:\wamp\bin\apache\Apache2.4.4\conf and then open up httpd.conf.
After that, search for httpd-vhosts.conf and make sure that there is no ‘#’ (pound sign) in front of it. Save. After that restart Wamp just to be safe.
Now let’s begin the fun part: installing Laravel.
Install Laravel in specified folder
You usually want to install your Laravel in your www folder. (Obviously!)
So open up your command prompt, and then change directory to your WWW folder inside your wamp. For me it will be: C:\wamp\www
To change directory, just type cd c:\wamp\www
Basically you are changing folder to your www folder.
And then, you can install Laravel. Just use this in your command prompt:
composer create-project laravel/laravel your-project-name –prefer-dist
And then hit enter.
Just wait a while until it is finished downloading and installing.
Enable Laravel installer
If you want to use Laravel Installer, you have to run this command in your command prompt first:
composer global require "laravel/installer"
Wait until… everything finished.
Create Virtual Host
Now let’s create your pretty URL. You have to go to C:\wamp\bin\apache\Apache2.4.4\conf\extra and then open up httpd-vhosts.conf.
After that, you just need to paste the following and change your laravel folder to appropriate ones.
<VirtualHost *:80>
DocumentRoot “c:/wamp/www/mylaravel/public”
ServerName laravel.dev
</VirtualHost>
In my case, I used mylaravel for my laravel installation. You have to change it to something else. For server name, you can change it to whatever you want. In my case, I am using laravel.dev. (You don’t want to use google.com because if you do, you won’t be able to open up Google).
Obviously, you have to save and then restart your WAMP again.
Update Windows Hosts file
After you have changed your virtual host, you need to change your host file.
Go to C:\Windows\System32\drivers\etc and copy hosts and paste it on your Desktop. And click on the host file you have pasted on your Desktop. Open that up using Notepad.
Put this in that host file:
127.0.0.1 laravel.dev
Change laravel.dev into what you already decided in your virtual host file. For me, mine will be laravel.dev.
Copy the one that you modified just now and put it back into your C:\Windows\System32\drivers\etc folder.
You’re done!
Modified from this source: http://copygrammer.com/how-to-install-laravel-on-windows/ (my blog)
Installing Laravel framework on window via Laravel installer:
make sure you have composer on your computer.
download the Laravel installer using Composer by typing following code in the command prompt:
composer global require "laravel/installer=~1.1"
go to folder:
C:\Users\ {User Name} \AppData\Roaming\Composer\vendor
copy the vendor folder and paste it into the folder (Destination folder) where you want to install Laravel project; for example, in folder D:\Test\Laravel.
after pasting, your folder structure look like this:
D:\Test\Laravel\vendor
pressing down on Shift key and Right click on the folder vendor in your destination folder (D:\Test\Laravel\vendor), and choose "open command window here".
enter the command below:
laravel new your_project_destination
after the command runs, you will see laravel folder in your_project_destination
You can install laravel using Homestead box.
There are a few steps you need to follow.
Make sure that you have windows virtualization turned ON in your BIOS. This will save you a few hours if you are installing it for the first time.
You will also need to install Vagrant and Virtual Box before starting the installation of Homestead.
The main advantages of using Homestead is that it provides a Linux virtual machine where you can easily install packages. It does comes with a lot of packages installed.
http://deepdivetuts.com/installing-laravel-5-4-on-windows-machine-using-homestead
If you have not installed composer on your system get from here.
You will get this if you have composer on your system installed
Installing Laravel
Step 1: Installing Laravel globally.
Open cmd in Windows and enter this command.
composer global require "laravel/installer"
This will download the latest version.
Check by entering the below command.
Step 2: Creating a new Laravel Project
Run the below command in cmd, blog is the name of my new project.
laravel new projectname
That's it. Now you have your new project folder in the directory you have saved.

Laravel 4 Installation Problems on WAMP/Windows

First,I use wamp on my Window7.I open php-openssl,and I git pull the laravel from github.com,and then I put laravel on my d:/wamp/www/, I change the c:/windows/system32.But when I open the url
http://localhost/laravel/public
I see this question.
I am a newbie on laravel,and without install on Ubuntu.Where is my wrong, without no pear,or something else? Thank you!
You need to run composer install in a command prompt.
If you do not have composer, download the phar file from their website.
Place the file you just downloaded into the laravel directory.
Then, make sure that the absolute path to php.exe is added to your PATH environment variable.
Then, you can hold down shift, and right click anywhere inside the laravel directory, and open up a command prompt window. Then, run php composer.phar install. The process may take some time, depending on the speed of your internet connection.
Instead of using the above method, you can download the Composer installer for Windows, install it, and just run composer install.
Note that you only need to do this in order to put the Laravel components together. You do not need to run it on a live server.
Please consult the Laravel Docs for installation and other instructions: http://laravel.com/docs
Try This :
Installing Laravel 4 on WAMP
1. Enable OpenSSL
OpenSSL must be enabled in the PHP configuration.
Edit php.ini in your WAMP’s PHP folder, e.g.:
C:\wamp\bin\php\php5.4.12\
Note: This is not the php.ini in C:\wamp\bin\apache\Apache2.4.4\bin.
Find the following line and remove the semicolon save it:
;extension=php_openssl.dll changed to extension=php_openssl.dll
2. Install Composer
(i).Download the Composer Windows installer from getcomposer.org.
(ii). Run the installer.
(iii). When it asks for the location of php.exe, point it to the executable in your WAMP’s PHP folder, e.g.:
C:\wamp\bin\php\php5.4.12\
(iv). Finish the installation.
(v). Open a command-line interface (cmd) and type:
composer
It should return a list of options. If you get an error, restart your computer and try again.
Composer has now been installed and added to your PATH environment variable. This means you can run it from any directory using the command-line interface.
Now we need to install Composer. This is a dependency manager that will download the latest release of Laravel and specific versions of Laravel’s dependencies, such as Doctrine and Symfony.
3.Install Laravel
Now that Composer has been installed, Composer can download and install Laravel onto your system.
(i). Open a command-line interface (cmd).
(ii). Go to the directory in which you want to install Laravel. This is usually your development directory. In this tutorial, we’ll use C:\wamp\www\laravel
(iii). Instruct Composer to install Laravel into a project directory. we use project name myproject.
composer create-project laravel/laravel myproject --prefer-dist
Note: This will install Laravel in a subdirectory myproject of the current working directory.
Three type of installation to be completed
Now your project was running directory like
C:\wamp\www\laravel\myproject\public\
After completed put tick mark and increase the point....
Do php composer.phar dump-autoload or php artisan dump-autoload

Resources