安裝top-think/framework

安裝一下 top-think/framework

因為裝了LNMP了…所以幾個步驟就不用了,也不裝自帶的啟動程序

 


[root@iZbp19k0gwrrfo0c9m43ojZ /]# php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');"
[root@iZbp19k0gwrrfo0c9m43ojZ /]# php composer-setup.php 
All settings correct for using Composer
Downloading...

Composer (version 1.8.5) successfully installed to: //composer.phar
Use it: php composer.phar

[root@iZbp19k0gwrrfo0c9m43ojZ /]# php -r "unlink('composer-setup.php');"
[root@iZbp19k0gwrrfo0c9m43ojZ /]# ls
bin   composer.phar  dev  home  lib64       media  nginx.conf.sam  php.ini.sam  root  sam   srv  te        tmp  var
boot  dataforlog     etc  lib   lost+found  mnt    opt             proc         run   sbin  sys  testfile  usr  www.conf.sam
[root@iZbp19k0gwrrfo0c9m43ojZ /]# mv composer.phar /usr/local/bin/composer
[root@iZbp19k0gwrrfo0c9m43ojZ /]# composer config -g repo.packagist composer https://packagist.phpcomposer.com
[root@iZbp19k0gwrrfo0c9m43ojZ /]# composer --version
Composer version 1.8.5 2019-04-09 17:46:47

Installing topthink/think (v5.1.35)
    Failed to download topthink/think from dist: The zip extension and unzip command are both missing, skipping.
Your command-line PHP is using multiple ini files. Run `php --ini` to show them.
    Now trying to download from source
  - Installing topthink/think (v5.1.35): Cloning d7f851fe5b

                                                                                                                               
  [RuntimeException]                                                                                                           
  Failed to clone https://github.com/top-think/think.git, git was not found, check that it is installed and in your PATH env.  
                                                                                                                               
  sh: git: command not found

缺少就補上
[root@iZbp19k0gwrrfo0c9m43ojZ sam]# yum install zip unzip
[root@iZbp19k0gwrrfo0c9m43ojZ sam]# yum install git

[root@iZbp19k0gwrrfo0c9m43ojZ sam]# composer create-project topthink/think tp5  --prefer-dist
Installing topthink/think (v5.1.35)
  - Installing topthink/think (v5.1.35): Downloading (100%)         
Created project in tp5
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 2 installs, 0 updates, 0 removals
  - Installing topthink/think-installer (v2.0.0): Downloading (100%)         
  - Installing topthink/framework (v5.1.35): Downloading (100%)         
Writing lock file
Generating autoload files

至此就完成啦,記得也要修改nginx的設定檔!