I. Installation of composer
$ sudo apt-get update
$ sudo apt-get install wget
$ wget Https://getcomposer.org/composer.phar
or $ Curl-o Https://getcomposer.org/composer.phar
Rename file Composer.phar to composer
$ mv Composer.phar composer
$ chmod +x composer can now run composer through the./composer command, but this is only limited to running in the current directory. To use the global, composer, set it as a global variable. Locate the composer file and move it to the/usl/local/bin directory so that you can use the composer command globally.
$ sudo mv Composer/usr/local/bin
In the terminal input $ composer will have the following display indicating that the installation was successful
second, the use of Composer installation Laravel
Composer version 1.4-dev (d8d0ee5870010253c98a7db4d27b07cd17bd6617) 2017-01-13 09:34:43 Usage
command [ Options] [arguments]
H,--help Display this help message
-Q,--quiet don't output any Message
-V,--version Display This application version
--ansi Force ANSI output
--no-ansi Disable ANSI Output
-N,--no-interaction do don't ask any interactive question
............ Wait a minute
To download the Laravel installation package using Composer:
Composer global require "Laravel/installer"
Make sure that the PATH environment variable has been added to the Composer/vendor/bin directory so that the executable laravel can be detected by your system. With the above installation composer, the composer directory that I want to add locally is:
So I added this bin directory to the/etc/profile and ~/.BASHRC files:
Export Path=/home/yan/.config/composer/vendor/bin: $PATH
Perform source/etc/profile and source ~/.BASHRC to make the environment effective immediately
Once the installation is complete, the terminal $ laravel-v can be
You can use the Laravel new command to create a newly installed Laravel application in the directory you specify. For example: the laravel new Blog command will create a directory named blog in the current directory, which contains the newly installed Laravel, and all dependent packages have been installed. This method can be installed much faster than through a Composer installation. third, the error solution
The system environment is: PHP 7.0.13-0 + ubuntu0.16.04.1 (CLI)
1. Failure to create a new project with Laravel My_app error
The Zip PHP extension is not installed. Please install it and try again.
Workaround install sudo apt-get install Php7.0-zip
2. Laravel/framework v5.2.18 requires ext-mbstring *-> The requested PHP extension mbstring is missing from your syste M.
Workaround execution sudo apt-get install php7.0-mbstring
You do not need to change the php.ini file.
3.phpunit/phpunit 4.0.2 requires Ext-dom *-> The requested PHP extension DOM is missing from your system.
Workaround execution sudo apt-get install Php-xml
4.pdoexception:could not find driver
Workaround execution sudo apt-get-y install Php-mysql