First, understand the next composer
1. Composer is a tool that manages PHP dependencies, allowing you to declare projects that rely on libraries and install them in your project. Its project-based management of ' packages ' or libraries, which install these packages or libraries under a folder in the project, will not have a global impact.
2. Composer The problem solved:
A) your project relies on many libraries
b) Some of these libraries also depend on other libraries
c) The library on which you declare
D) composer to resolve which versions of the packages need to be installed and installed (which means downloading to the user's project)
3. Declaration of Dependence:
Suppose you want to create a new project, you need a library to log the logs and decide to use Monolog. In order to bring the library to your project, you just need to create a file named ' Composer.json ' to describe the dependencies of the project
{ "require": { "monolog/monolog" "1.2.*" } }
Simply declaring a project requires any package that starts with version 1.2 monolog/monolog
.
Second, according to the official website of the docs steps to install LARAVEL1. Installing composer
Download Windows Installer Double-click Run Composer-setup.exe, will automatically detect the installed Php.exe, click Next until the Install button appears, click after the error may occur:
That is, you need to turn on PHP's OpenSSL function, open your php.ini file, find it, Extension=php_openssl.dll The statement, remove the previous semicolon comment to restart Apache, and then reinstall it.
2. Installing Laravel
Three types of installation options are available on the official website:
1) Installation via Laravel installer
Run the cmd command to open a command-line window and enter the following command:
" laravel/installer=~1.1 "
Wait for the installation to complete, after installation, you need to add the path into path in order to use the Lavarel command, at the beginning of the installation there is a word based on this location to find the path:
First of all, in the folder options to display all hidden files in order to find the AppData folder under their own user name, add C:\Users\ your username \appdata\roaming\composer\vendor\bin to the environment variable path.
Then run the laravel command: Laravel new <project name>
Open the Blog folder under G Disk:
2) installation via composer Create-project
Also enter the following command in CMD:
Composer Create-project Laravel/laravel--prefer-dist
After executing the command, the entire installation process is shown in the command-line window, and the content in the Laravel project folder under G-Disk is the same as Method 1).
3) Install by download
Download the latest version of Laravel, unzip it after downloading,
The contents of the file are:
Enter the following command on the command line:
Install
The following error is displayed after running:Could not input open File:composer.phar
Study for half a day do not know why, then use the following command to replace it, but also simple, the same can be installed success:
Install
After the operation is complete, the contents of the Laravel-master become:
More than three files as shown.
Third, the system needs
- PHP >= 5.4
- MCrypt PHP Extension (php>=5.3 open Mcypt Extensions by default)