打开官网,找到这里点击手册

或者直接访问 这里

可以看到TP6已经有了赞助商

然后往后面阅读,发现他推荐我们读这个

这个入门必读还是不错的,简单的看看就行

后面就开始安装吧

首先注意自己的环境php版本以及composer是否已经安装配置了

后面有这个提示说composer太慢可以这样配置,我觉得华为云的挺好的,我们就采用这个

composer config -g repo.packagist composer https://repo.huaweicloud.com/repository/php/

然后就是初步安装

composer create-project topthink/think tp6

这个tp6就是你要存储的代码的文件夹,这里你可以随便改,之后就创建了我们的项目代码了.

执行过程

Creating a "topthink/think" project at "./tp6"
Installing topthink/think (v6.0.13)
- Installing topthink/think (v6.0.13): Loading from cache
Created project in /home/zhaoyao/script/php/tp/tp6
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 16 installs, 0 updates, 0 removals
- Installing topthink/think-helper (v3.1.6): Loading from cache
- Installing psr/log (1.1.4): Loading from cache
- Installing psr/simple-cache (1.0.1): Loading from cache
- Installing topthink/think-orm (v2.0.54): Loading from cache
- Installing symfony/polyfill-php80 (v1.26.0): Loading from cache
- Installing symfony/polyfill-php72 (v1.26.0): Loading from cache
- Installing symfony/polyfill-mbstring (v1.26.0): Loading from cache
- Installing symfony/var-dumper (v4.4.44): Loading from cache
- Installing psr/container (1.1.2): Loading from cache
- Installing psr/cache (1.0.1): Loading from cache
- Installing league/mime-type-detection (1.11.0): Loading from cache
- Installing league/flysystem (1.1.9): Loading from cache
- Installing league/flysystem-cached-adapter (1.1.0): Loading from cache
- Installing psr/http-message (1.0.1): Loading from cache
- Installing topthink/framework (v6.0.13): Loading from cache
- Installing topthink/think-trace (v1.4): Loading from cache
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 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!
> @php think vendor:publish
Succeed!
6 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

然后进入tp6文件夹

cd tp6

进行列表查看 ls -l

total 80
drwxrwxr-x 3 zhaoyao zhaoyao 4096 5月 31 12:54 app/
-rw-rw-r-- 1 zhaoyao zhaoyao 1099 5月 31 12:54 composer.json
-rw-rw-r-- 1 zhaoyao zhaoyao 32490 8月 8 09:52 composer.lock
drwxrwxr-x 2 zhaoyao zhaoyao 4096 8月 8 09:52 config/
drwxrwxr-x 2 zhaoyao zhaoyao 4096 5月 31 12:54 extend/
-rw-rw-r-- 1 zhaoyao zhaoyao 1822 5月 31 12:54 LICENSE.txt
drwxrwxr-x 3 zhaoyao zhaoyao 4096 5月 31 12:54 public/
-rw-rw-r-- 1 zhaoyao zhaoyao 1459 5月 31 12:54 README.md
drwxrwxr-x 2 zhaoyao zhaoyao 4096 5月 31 12:54 route/
drwxrwxr-x 2 zhaoyao zhaoyao 4096 5月 31 12:54 runtime/
-rw-rw-r-- 1 zhaoyao zhaoyao 180 5月 31 12:54 think
drwxrwxr-x 8 zhaoyao zhaoyao 4096 8月 8 09:52 vendor/
drwxrwxr-x 2 zhaoyao zhaoyao 4096 5月 31 12:54 view/

好了,代码已经好了,你可以选择直接将站点部署到 public/ 目录下,也可以选择直接

php think run

然后就跑起来了 访问 http://127.0.0.1:8000/ 即可.

后续思考:

我们使用命令行方式运行起这个站点,等于让php做了web server服务器,那么这个终端就要一直运行挂着,不能中断,不然ctrl+c就把服务断了.

使用命令行运行,那些代码就等于在用命令行执行的身份在跑,那权限和身份是不是会有变化呢?普通的apache/nginx的权限跑的代码是没有那么高的权限的,现在用命令行跑,肯定权限高了不少,到时候又该如何防止权限泛滥呢?

正因为权限提高了,我们是不是可以做一些权限的事情呢?比如利用这个做一个svn代码拉取工具,执行svn up,同理git,进行git pull 命令,拉取代码,就相当与我们只要页面上面点击一下就能实现服务器上面的代码拉取自动更新了.

命令行这样执行和直接php fpm这样执行效率上面有什么差异吗?代码需要每次都重新加载吗?fpm的压力是否会减小?服务器是否可以减小CPU消耗呢?

1.TP6的入门-安装的更多相关文章

  1. Debian 入门安装与配置2

    Debian 入门安装与配置2 1. C/C++开发必装软件 atp-get install gcc    这个不用说,用来编译C程序 apt-get install g++ 用来编译C++程序 ap ...

  2. Debian 入门安装与配置1

    Debian 入门安装与配置1 最近安装了多个发行版本的Linux,包括Ubuntu.Fedora.Centos和Debian,发现只有Debian在界面和稳定性等综合特性上表现最优,自己也最喜欢,所 ...

  3. Activity工作流(2)-入门安装运行第一个例子

    转: Activity工作流(2)-入门安装运行第一个例子 置顶 2017年05月24日 15:58:50 li_ch_ch 阅读数:24432   版权声明:本文为博主原创文章,未经博主允许不得转载 ...

  4. elk系列1之入门安装与基本操作【转】

    preface 我们每天都要查看服务器的日志,一方面是为了开发的同事翻找日志,另一方面是巡检服务器查看日志,而随着服务器数量以及越来越多的业务上线,日志越来越多,人肉运维相当痛苦了,此时,参考现在非常 ...

  5. react入门安装

    react的入门安装 1.react的适用方法有两种,其一是依赖在线的cdn地址: https://reactjs.org/docs/cdn-links.html 官方给的cdn地址如下 <sc ...

  6. Redis介绍及入门安装及使用

    Redis介绍及入门安装及使用 什么是Redis Redis is an open source (BSD licensed), in-memory data structure store, use ...

  7. JAVA手记 JAVA入门(安装+Dos下运行)

    JAVA入门特供= =,今天设置环境变量后用dos运行的时候发现出现“找不到或无法加载主类”,索性查了些资料重新看了看JAVA入门的部分. 声明:我的笔记本暂时用的是Win10系统,Windows其他 ...

  8. zookeeper windows 入门安装和测试

    一.序言       以下是我对zookeeper 的一些理解:       zookeeper 作为一个服务注册信息存储的管理工具,好吧,这样说得很抽象,我们举个“栗子”. 栗子1号: 假设我是一家 ...

  9. [译]:Orchard入门——安装Orchard

    原文链接:Installing Orchard 文章内容基于Orchard 1.8版本 安装Orchard的方式 主要有以下四种方式安装Orchard: 利用Microsoft Web Platfor ...

  10. Kafka入门 --安装和简单实用

    一.安装Zookeeper 参考: Zookeeper的下载.安装和启动 Zookeeper 集群搭建--单机伪分布式集群 二.下载Kafka 进入http://kafka.apache.org/do ...

随机推荐

  1. AutoMaper使用

    使用 AutoMapper 进行赋值 一. 什么是 AutoMapper AutoMapper是对象到对象的映射工具.在完成映射规则之后,AutoMapper可以将源对象转换为目标对象. 二. Aut ...

  2. Ubuntu 切换显示管理器

    比较流行的显示管理器有: gdm3 - GNOME Display Manager lightdm - Light Display Manager sddm - Simple Desktop Disp ...

  3. Clobotics 计算机视觉场景存储实践:多云架构、 POSIX 全兼容、低运维的统一存储

    Clobotics 是一家将计算机视觉和机器学习技术应用于风电以及零售行业的企业.在风电行业,Clobotics 利用无人机对风力发电机叶片进行检查,显著降低了对人工作业的依赖.在零售领域,公司通过分 ...

  4. 在 Web 中判断页面是不是刷新

    在 Web 开发中,我们经常需要区分用户是否通过刷新操作重新加载了页面.这一操作可能是由用户手动刷新(如按下 F5 键或点击浏览器刷新按钮)或通过浏览器自动重新加载.判断页面是否刷新有助于开发者优化用 ...

  5. CSS & JS Effect – Show More

    效果 show more 是很常被使用的效果, 因为空间总是不够的丫. 比起 scroll, show more 的体验通常会好一些, 尤其在手机, 它有更好的引导. 实现思路   1. 卡片需要一个 ...

  6. 《Spring Data JPA从入门到精通》内容简介、前言

    内容简介 本书以Spring Boot为技术基础,从入门到精通,由浅入深地介绍Spring Data JPA的使用.有语法,有实践,有原理剖析. 本书分为12章,内容包括整体认识JPA.JPA基础查询 ...

  7. 墨天轮访谈 | OceanBase 白超:海量数据管理,为什么选择OceanBase?

    分享嘉宾:白超(大窑) OceanBase解决方案架构师.前蚂蚁集团数据库团队DBA专家 整理:墨天轮社区 导 读 大家好,我是白超(花名:大窑),在过去的几年中,作为蚂蚁集团数据库SRE团队成员,经 ...

  8. 使用datagrip时,报错 connection refused

    因为数据库没有开启 : 打开终端 输入(管理员身份): net start mysql80   (这是你的数据库的名字)

  9. Nuxt.js 应用中的 restart 事件钩子详解

    title: Nuxt.js 应用中的 restart 事件钩子详解 date: 2024/10/14 updated: 2024/10/14 author: cmdragon excerpt: re ...

  10. 工作使用:Exchange问题汇总

    工作使用:Exchange问题汇总 1:邮件不能发给公司内部的人,但是可以发公司外部人员 解析:GC出问题 2:xchange 2016环境,最近经常发生邮件队列堆积的现象.邮件服务器整体性能看上去没 ...