I am a Windows system
Phpstudy is the latest 2018 version
To install the Laravel framework as an example
One by one, click PHP Composer to appear the system command box, according to the Command box path to find the file
Two red boxes in the file delete
Three in the instruction box input instruction
Since I have downloaded the following instructions, I can't.
Reference article https://pkg.phpcomposer.com/#how-to-install-composer
1. Be sure to install PHP correctly before installing. Open a command-line window and perform a php -v
check to see if the version number is output correctly.
2. Open the command line and execute the following command sequentially to install the latest version of Composer
Download the installation script- composer-setup.php
-to the current directory
"copy (' Https://install.phpcomposer.com/installer ', ' composer-setup.php '); "
3. Perform the installation process.
PHP composer-setup.php
4. Delete the installation script.
"unlink (' composer-setup.php '); "
Four set system global variables, see my article https://www.cnblogs.com/wen-zi/p/9072547.html
The global installation is to install Composer PATH
under the path contained in the system environment variable, and then execute the command directly in the command composer
-line window.
There are also PHP (Php.exe directory) global variables placed into the system environment variable path such as E:\PHPTutorial\php\php-5.6.27-nts; E:\PHPTutorial\php\php-5.4.45-nts; E:\PHPTutorial\php\php-5.5.38; E:\PHPTutorial\tools\composer
Mac or Linux system:
Open a command-line window and execute the following command to move the previously downloaded composer.phar
file to the /usr/local/bin/
directory:
Copy
sudo mv composer.phar /usr/local/bin/composer
Windows System:
- Locate and go to the installation directory of PHP (and the instructions you execute on the command line
php
should be the same set of PHP).
- will be
composer.phar
copied to PHP under the installation directory, that is, and php.exe
in the same level directory.
- Create a new file in the PHP installation directory
composer.bat
and save the following code to this file.
Copy
@php "%~dp0composer.phar" %*
Finally reopen a command-line window and try it out to composer --version
see if the version number is correctly printed.
Five Download Example Laravel framework
Reference article http://laravelacademy.org/post/306.html
1, open the new command box, click on the lower left corner of the computer, enter CMD
2, enter the command to your corresponding project file path
For example, I put it in dome.
Instructions
Not the same disk must remember to switch to the corresponding disk, d disk is cd/d; The F-plate is cd/f, followed by the corresponding file path
The rest of the operation is the same as the link above
Phpstudy Composer using the installation