下载地址:
www.thinkphp.cn/down/p/1.html
文档地址:
www.kancloud.cn/manual/thinkphp5/209035
=================
以上网址都没怎么用上,因为镜像是国外的网速太慢了,但有部分引导作用。
于是参考了菜鸟教程的
Composer 安装与使用 | 菜鸟教程
Linux 平台可以使用以下命令来安装:
# php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');" # php composer-setup.php All settings correct for using Composer Downloading... Composer (version 1.6.5) successfully installed to: /root/composer.phar Use it: php composer.phar
移动 composer.phar,这样 composer 就可以进行全局调用:
# mv composer.phar /usr/local/bin/composer
切换为国内镜像:
# composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
更新 composer:
# composer selfupdate
====================
切换到想安装的目录(一般就是宝塔创建网站的index.thml的同级目录)
执行下面语句
composer create-project topthink/think=5.0.24 tp5 --prefer-dist
如下图
整个安装过程都不太耗时,1分钟内吧,如果出现耗时操作,就不正常了。
我上面笔记已经整理好的,认真执行一般不会有任何问题。
==========================
以下是遇到的错误,作为记录用,也许有参考价值,一般是没啥用,不用看了。
====================================
1. 输入 网址发现,是一堆错误日志,请检查
1. 宝塔里的 跨网站攻击,取消勾选。
2. composer create-project topthink/think=5.0.24 tp5 --prefer-dist 红色的小版本好切记要写,不然就没有start.php
出现的错误:
[InvalidArgumentException]
Could not find package topthink/think with version 5.1.*.
===
解决方案:
之前使用的镜像是:composer config -g repo.packagist composer https://packagist.phpcomposer.com
现切换镜像为:composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
记得还有个putdev命令错误,忘记截图了。是因为php的设置有禁止这个命令,直接删掉禁止选项即可。
贴图如下
遇到个错误
Problem 1
- league/flysystem[1.1.0, ..., 1.1.10] require ext-fileinfo * -> it is missing from your system. Install or enable PHP's fileinfo extension.
- topthink/think-filesystem[v1.0.0, ..., v1.0.1] require league/flysystem ^1.1.4 -> satisfiable by league/flysystem[1.1.4, ..., 1.1.10].
- Root composer.json requires topthink/think-filesystem ^1.0 -> satisfiable by topthink/think-filesystem[v1.0.0, v1.0.1].
To enable extensions, verify that they are enabled in your .ini files:
- /www/server/php/74/etc/php.ini
You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with `--ignore-platform-req=ext-fileinfo` to temporarily ignore these required extensions.
[root@VM-4-10-centos www.xinxinti.com]#
解决方案:composer --ignore-platform-req=ext-fileinfo create-project topthink/think tp888
增加 --ignore-platform-req=ext-fileinfo, 修改 php.ini是没用的,原因未知
问题3
proc_open函数被禁用,只需要开启函数即可。
最后要重定向域名,
用宝塔面板即可。
贴图如下
注意跨站攻击记得取消勾选,否则有问题,原因未知