PHP - composer 安装最新ThinkPHP
in PHP with 0 comment

PHP - composer 安装最新ThinkPHP

in PHP with 0 comment

PHP - composer 安装最新Thinkphp

说明

记录一下用composer安装最新Thinkphp

Packagist:https://packagist.org/
ThinkPHP官网:http://www.thinkphp.cn


安装步骤

1.打开Packagist,搜索topthink
Packagist 是主要的Composer仓库。它集合了与Composer一起安装的公开 PHP 软件包。

think

2.点进去之后就可以看到安装信息,以及其他版本,系统要求之类的。
请输入图片描述

3.在自己的项目目录下执行安装命令

$ composer create-project topthink/think tp 6.0.*

以下是安装信息:

Installing topthink/think (v6.0.2)
  - Installing topthink/think (v6.0.2): Downloading (100%)
Created project in tp
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 14 installs, 0 updates, 0 removals
  - Installing psr/container (1.0.0): Downloading (100%)
  - Installing topthink/think-helper (v3.1.3): Downloading (100%)
  - Installing psr/log (1.1.2): Downloading (100%)
  - Installing psr/simple-cache (1.0.1): Downloading (100%)
  - Installing topthink/think-orm (v2.0.31): Downloading (100%)
  - Installing symfony/polyfill-php72 (v1.13.1): Downloading (100%)
  - Installing symfony/polyfill-mbstring (v1.13.1): Downloading (100%)
  - Installing symfony/var-dumper (v4.4.4): Downloading (100%)
  - Installing opis/closure (3.5.1): Downloading (100%)
  - Installing psr/cache (1.0.1): Downloading (100%)
  - Installing league/flysystem (1.0.64): Downloading (100%)
  - Installing league/flysystem-cached-adapter (1.0.9): Downloading (connecting.Downloading (100%)
  - Installing topthink/framework (v6.0.2): Downloading (100%)
  - Installing topthink/think-trace (v1.2): Downloading (100%)
symfony/var-dumper suggests installing ext-intl (To show region name in time zone dump)
symfony/var-dumper suggests installing symfony/console (To use the ServerDumpCommand and/or the bin/var-dump-server script)
league/flysystem suggests installing league/flysystem-eventable-filesystem (Allows you to use EventableFilesystem)
league/flysystem suggests installing league/flysystem-rackspace (Allows you to use Rackspace Cloud Files)
league/flysystem suggests installing league/flysystem-azure (Allows you to use Windows Azure Blob storage)
league/flysystem suggests installing league/flysystem-webdav (Allows you to use WebDAV storage)
league/flysystem suggests installing league/flysystem-aws-s3-v2 (Allows you to use S3 storage with AWS SDK v2)
league/flysystem suggests installing league/flysystem-aws-s3-v3 (Allows you to use S3 storage with AWS SDK v3)
league/flysystem suggests installing spatie/flysystem-dropbox (Allows you to use Dropbox storage)
league/flysystem suggests installing srmklive/flysystem-dropbox-v2 (Allows you to use Dropbox storage for PHP 5 applications)
league/flysystem suggests installing ext-ftp (Allows you to use FTP server storage)
league/flysystem suggests installing league/flysystem-sftp (Allows you to use SFTP server storage via phpseclib)
league/flysystem suggests installing league/flysystem-ziparchive (Allows you to use ZipArchive adapter)
league/flysystem-cached-adapter suggests installing ext-phpredis (Pure C implemented extension for PHP)
Writing lock file
Generating autoload files
> @php think service:discover
Succeed!

4.项目目录下有tp文件夹就成功了。

配置虚拟主机

1.在自己的hosts文件下添加虚拟域名tp.com,自己有域名的可以分配

127.0.0.1 tp.com

2.添加解析文件,nginx示例:

server {
        listen        80;
        server_name  tp.com;
        root   "F:/360/phpstudy_pro/WWW/web/tp/public/";
        access_log "F:/360/phpstudy_pro/WWW/log/tp_success.log"; 
        error_log  "F:/360/phpstudy_pro/WWW/log/tp_error.log" error; 
        location / {
            index index.html index.php;
            if ( !-e $request_filename) {
                rewrite ^/(.*)$ /index.php/$1 last;
                break;
            } 
        }

        location ~ \.php(.*)$ {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            fastcgi_param  PATH_INFO  $fastcgi_path_info;
            fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
            include        fastcgi_params;
        }
}

3.重启nginx,浏览器访问tp.com,安装成功啦。

请输入图片描述

结尾

酒入豪肠,七分化作月光;剩下的三分,啸成了剑气,绣口一吐,就是半个盛唐。

Responses