首页 > 其他分享 >1.TP6的入门-安装

1.TP6的入门-安装

时间:2022-10-20 10:00:19浏览次数:76  
标签:league Loading 入门 flysystem cache Installing TP6 zhaoyao 安装

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

1.TP6的入门-安装_php

 

或者直接访问 ​​这里​

 

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

1.TP6的入门-安装_php_02

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

1.TP6的入门-安装_php_03

 

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

后面就开始安装吧

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

1.TP6的入门-安装_symfony_04

 

后面有这个提示说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

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

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

php think run

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

1.TP6的入门-安装_symfony_05

 

后续思考:

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

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

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

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



标签:league,Loading,入门,flysystem,cache,Installing,TP6,zhaoyao,安装
From: https://blog.51cto.com/u_15470226/5777709

相关文章

  • 二、Python入门
    一、第一句Python代码编辑/scripts目录下编辑hello.py输入1print("hello,word")执行hello.py 即python3/scripts/hello.pypython内部执行过程如下: ......
  • JDBC-快速入门和DriverManager注册驱动
    JDBC-快速入门步骤:1.导入驱动jar包(依赖也可以)<dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId><version>8.0.......
  • 【2022.10.20】Linux入门基础(3)
    内容概要1.目录结构说明2.重要目录数据信息3.网络不通排查流程4.etc目录下重要的数据文件5.usr目录下重要的数据文件6.proc目录下重要的数据文件7.系统优化相关......
  • 572 HTML概念介绍 amd 573 HTML快速入门
    HTML概念介绍概念:是最基础的网页开发语言 HyperTextMarkupLanguage超文本标记语言 超文本:超文本是用超链接的方法,将各种不同空间的文字信息组织在......
  • Nginx 在windows下的安装及使用(负载均衡 多服务器配置)
    1.下载nginxhttp://nginx.org/en/download.html下载稳定版本,以nginx/Windows-1.12.2为例,直接下载nginx-1.12.2.zip下载后解压,解压后如下  2.启动nginx有很多种方......
  • JDBCTemplate-介绍和JDBCTemplate-快速入门
    JDBCTemplate-介绍SpringJDBCSpring框架对JDBC的简单封装。提供了一个JDBCTemplate对象简化JDBC的开发步骤:1.导入jar包2.创建JDBCTemplate对象。依赖于......
  • 尝试在Ubuntu中安装Emacs遇到的问题
    出现具体问题今日学习安装emacs在Ubuntu19.04当中安装详见下方帖子:链接:如何在Ubuntu中安装Emacs.安装遇到问题,即sudoadd-apt-repositoryppa:kelleyk/emacs该步......
  • 在Ubuntu19.04系统中安装Emacs遇到的问题
    安装显示部分依赖软件包现在无法安装发现emacs26无法安装后来查阅资料,发现在Ubuntu18版本及以上就不需要更新了即不需要以下操作:sudoaptupdate同时安装也需要将em......
  • docker安装mysql
    一、安装mysql1、dockerpullmysql:8.0.23 下载mysql镜像2、创建容器dockerrun-it-d--namemysql--net=host\-m500m-v/root/mysql/data:/var/lib/mysql\-v......
  • 【番外篇】Rust环境搭建+基础开发入门+Rust与.NET6、C++的基础运算性能比较
    前言:突然想打算把Rust作为将来自己主要的副编程语言。当然,主语言还是C#,毕竟.NET平台这么强大,写起来就是爽。缘起:之前打算一些新的产品或者新的要开发的东西,由于没有历史包......