Home  >  Article  >  Development Tools  >  How to install phpstudy composer

How to install phpstudy composer

藏色散人
藏色散人forward
2020-09-14 13:28:569407browse

The following tutorial column will introduce you to the use and installation of phpstudy composer from composer. I hope it will be helpful to friends in need!

How to install phpstudy composer

I am a windows system

phpstudy is the latest 2018 version

(Download address: https://www.php .cn/xiazai/gongju/845)

Take the installation of laravel framework as an example

As shown in Figure 1, click on php Composer to display the system command box, and find the file according to the path of the command box

How to install phpstudy composerHow to install phpstudy composer

Second, delete the files in the red box

How to install phpstudy composer

Third, enter the command in the command box

How to install phpstudy composer

Since I have already downloaded the screenshots of the following instructions, I will not take screenshots.

Reference article https://pkg.phpcomposer.com/#how-to-install-composer

1, please make sure that PHP has been installed correctly before installation. Open a command line window and execute php -v to check whether the version number is correctly output.

2, open the command line and execute the following commands in order to install the latest version of Composer

Download the installation script - composer-setup.php - Go to the current directory

php -r "copy(‘https://install.phpcomposer.com/installer‘, ‘composer-setup.php‘);"

3, execute the installation process.

php composer-setup.php

4, delete the installation script.

php -r "unlink(‘composer-setup.php‘);"

4 Set the system global variables, see my article https://www.cnblogs.com/wen-zi/p/9072547.html

Global installation is to install Composer into the system environment Under the path contained in the variable PATH, you can then directly execute the composer command in the command line window.

There are also php (php.exe directory) global variables placed in the path of the system environment variables​​​​​​​​

For example, E:\PHPTutorial\php\php-5.6.27-nts; \php\php-5.4.45-nts;E:\PHPTutorial\php\php-5.5.38;E:\PHPTutorial\tools\composer

Mac or Linux system:

Open Open the 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:

  1. Find and enter the PHP installation directory (it should be the same set of PHP as the php command you executed on the command line ).
  2. Copy composer.phar to the PHP installation directory, which is the same level directory as php.exe.
  3. Create a new composer.bat file in the PHP installation directory and save the following code into this file.

Copy

@php "%~dp0composer.phar" %*

Finally reopen a command line window and try to execute it composer --version See if the version is output correctly Number.

Five download examples laravel framework

Reference article http://laravelacademy.org/post/306.html

1, open a new command box, click on the lower left corner of the computer , enter cmd

How to install phpstudy composer

2, enter the command to your corresponding project file path

For example, I put it in dome

How to install phpstudy composer

CommandHow to install phpstudy composer

If you are not on the same disk, be sure to switch to the corresponding disk. The d disk is cd /d; the f disk is cd /f; add the corresponding file path after it

The rest of the operations are the same as the link above.

The above is the detailed content of How to install phpstudy composer. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:cnblogs.com. If there is any infringement, please contact admin@php.cn delete