Detailed explanation: Install TP5.1 (Thinkphp5.1) through composer

  Now TP5 is getting more and more popular, and TP5 has also been updated to version 5.1, but versions above 5.1 can only be installed through composer, so here are the detailed steps

  Reference URL: http://www.thinkphp.cn/topic/52362.html

  

1. Put the PHP version into the environment variable

  (1) Check the version number selected in phpstudy:

 

  (2) Find the corresponding version number file location in phpstu/php

  

 

  (3) Open "My Computer" -> select "Properties" -> click "Advanced System Settings" -> select the "Advanced" tab

 

  (4) Select "path", add our version number path, remember to add a semicolon before adding ; to distinguish, click "OK" to

 

 

2. Install composer.phar

  (1) Open the composer Chinese website http://www.phpcomposer.com/

 

  (2) Click "Download"

  

 

  (3) Find the place to download the content and download the latest version of composer.phar

  

 

   (4) Download to the folder you want to download. For example, I downloaded it under the phpstudy/www/tp5.1 folder. After downloading, we can see composer.phar in the folder

  

 

  (5) After downloading, we don't need to install it, just get this file and use it directly to test the availability of composer.phar, then we need to test it through commands from cmd.
    We divide it into several steps to test the availability. :

    1) First find the location of the php.exe file of the PHP version in phpstudy

    

 

  2) Open the command window: win+R and then enter cmd and press Enter as shown in the figure, this is the command window

  

 

    3) Because the file location of the composer.phar I installed is in the D drive, the conversion drive is the D drive

 

   4) Find the location where we installed composer.phar

 

   5) After splicing, we can test the availability of composer.phar. Statement: The path of php.exe used in our phpstudy + a space + composer.phar + space-V (the last V must be a capital letter V)) The -V command is to find the version of composer

  

  At this point, our composer is installed, and we can proceed to the next step.

 

3. Download the Chinese mirror

  (1) Composer Chinese website: http://www.phpcomposer.com/, click on the Chinese mirror to enter as shown in the figure

 

  (2) There are 2 methods, we choose the first one:

 

 

  

  

     After this step is completed, we can install TP5.1

 

4. Install TP5.1

  (1) Open the Chinese website: https://packagist.org/

    

 

   (2) Input: openthink, indicating TP5

  

 

  (3) Copy the command:

 

  (4) Paste it into the cmd command: php.exe path + composer.phar + the statement just copied

  

 

   At this point, our installation has been completed

 

5. Run TP5

  (1) Let's go to the installed directory to see if there is a TP5 file

  

 

  

 

 

  (2) Next, we configure a virtual host for TP5.1, that is, configure a domain name for TP5.1, which is convenient for us to operate on tp5.1

    Note: The website directory should be configured under the public file, because the entry file of TP5.1 is in public

    If you don't know how to configure the domain name, please refer to my other tutorial: http://www.cnblogs.com/finalanddistance/p/8877478.html

  

 

  (3) After configuring the domain name, we access TP5:

  

 

  This icon appears to indicate that we successfully installed TP5.1! !

 

 

  The above is the entire detailed process. If there is anything wrong or unclear, please leave a message and I will try my best to answer it for you! Let's make progress together! !

  END

 

 

 

 

 

 

 

  

 

 

 

 

  

 

 

  

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324808856&siteId=291194637