1.TP6的入门-安装

1.TP6的入门-安装打开官网,找到这里点击手册或者直接访问这里可以看到TP6已经有了赞助商然后往后面阅读,发现他推荐我们读这个这个入门必读还是不错的,简单的看看就行后面就开始安装吧首先注意自己的环境php版本以及composer是否已经安装配置了后面有这个提示说composer太慢可以这样配置,我觉得华

大家好,欢迎来到IT知识分享网。

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

1.TP6的入门-安装

 

或者直接访问 这里

 

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

1.TP6的入门-安装

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

1.TP6的入门-安装 

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

后面就开始安装吧

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

1.TP6的入门-安装 

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

1.TP6的入门-安装

 

后续思考:

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

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

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

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

免责声明:本站所有文章内容,图片,视频等均是来源于用户投稿和互联网及文摘转载整编而成,不代表本站观点,不承担相关法律责任。其著作权各归其原作者或其出版社所有。如发现本站有涉嫌抄袭侵权/违法违规的内容,侵犯到您的权益,请在线联系站长,一经查实,本站将立刻删除。 本文来自网络,若有侵权,请联系删除,如若转载,请注明出处:https://yundeesoft.com/32249.html

(0)

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

关注微信