PHP composer包管理器安装及ThinkPHP8的常见安装问题解决办法

composer包管理器安装

https://getcomposer.org/Composer-Setup.exe

集成环境

  • phpstudy --> 小皮
  • phpenv

TP的安装

修改为国内的阿里云源:

composer config -g repo.packagist composer https://mirrors.aliyun.com/composer
cd D:\Develop\phpstudy_pro\WWW

composer create-project topthink/think www.tp.com
  • 要求php版本不低于php8

Cannot use topthink/think’s latest version v8.0.0 as it requires php >=8.0.0 which is not satisfied by your platform.

  • 当升级到PHP8版本时,可能会出现如下报错:
Fatal error: Directive 'track_errors' is no longer available in PHP in Unknown on line 0

解决办法:

track_errors=off
或者删除该行
  • The openssl extension is required for SSL/TLS protection but is not available. If you can not enable the openssl ex tension, you can disable this error, at your own risk, by setting the ‘disable-tls’ option to true.
    • 配置ssl扩展,编辑php.ini文件,加入下面两行
extension_dir=ext
extension=php_openssl.dll
  • Alternatively, you can run Composer with --ignore-platform-req=ext-fileinfo to temporarily ignore these required extensions.
composer create-project topthink/think www.tp.com --ignore-platform-req=ext-fileinfo

或者在php.ini配置:

extension=php_fileinfo.dll
  • 访问网站时报错:You don’t have permission to access / on this server.
解决办法:需要配置到public这一层级:
D:/Develop/phpstudy_pro/WWW/www.tp.com/public
  • 25
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

学亮编程手记

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值