A

Array and string offset access syntax with curly braces is no longer supported解决办法

HB 网络电脑 2025-05-03

错误提示:

Error /application/function.php line 770 or so
Array and string offset access syntax with curly braces is no longer supported

客户网站搬迁至 hostuno 服务器,部署时显示以上错误提示,查询服务器配置后结论:服务器PHP版本从5.6 ~ 8.4均支持,默认版本8.1.31,而客户站点系统PHP版本最高只支持7.0。
解决办法:编写一个.htaccess文件指定PHP版本上传至服务器。
.htaccess 完整内容:

AddType application/x-httpd-php70  .php

本例 hostuno 服务器:

usr/home/LOGIN/domains/DOMAIN/.htaccess

如果你在 hostuno 还有其他站点,那么根据站点php版本要求,修改本例版本号后存放对应站点目录位置:

usr/home/LOGIN/domains/DOMAIN/public_html/.htaccess

PREV
Docker部署测速工具Speedtest-x
NEXT
一站式SSL证书管理工具All in SSL