PHP

pecl安装程序时报错Array and string offset access syntax with curly braces is no longer supported

字号+ 编辑: 种花家 修订: 种花家 来源: 原创 2023-09-12 我要说两句(1)

记述一次使用不对称版本pecl的惊险奇遇。

早些时间因为想通过pecl安装event插件, 于是乎发生了这样的场景:

user1@some-instances:~# pecl install event
Fatal error: Array and string offset access syntax with curly braces is no longer supported in /usr/share/php/PEAR/Config.php on line 2095
user1@some-instances:~# vim /usr/share/php/PEAR/Config.php
user1@some-instances:~# pecl install event
Fatal error: Array and string offset access syntax with curly braces is no longer supported in /usr/share/php/PEAR/Registry.php on line 1190
user1@some-instances:~# vim /usr/share/php/PEAR/Registry.php
user1@some-instances:~# pecl install event
Fatal error: Array and string offset access syntax with curly braces is no longer supported in /usr/share/php/PEAR/Registry.php on line 1241
user1@some-instances:~# vim /usr/share/php/PEAR/Registry.php
user1@some-instances:~# pecl install event
Fatal error: Array and string offset access syntax with curly braces is no longer supported in /usr/share/php/PEAR/Registry.php on line 1265
user1@some-instances:~# vim /usr/share/php/PEAR/Registry.php
user1@some-instances:~# pecl install event
Fatal error: Array and string offset access syntax with curly braces is no longer supported in /usr/share/php/PEAR/Registry.php on line 2207
user1@some-instances:~# vim /usr/share/php/PEAR/Registry.php
user1@some-instances:~# pecl install event
Fatal error: Array and string offset access syntax with curly braces is no longer supported in /usr/share/php/PEAR/DependencyDB.php on line 177
user1@some-instances:~# vim /usr/share/php/PEAR/DependencyDB.php
user1@some-instances:~# pecl install event
Fatal error: Array and string offset access syntax with curly braces is no longer supported in /usr/share/php/PEAR/Installer/Role.php on line 240
user1@some-instances:~# vim /usr/share/php/PEAR/Installer/Role.php
user1@some-instances:~# pecl install event
Fatal error: Array and string offset access syntax with curly braces is no longer supported in /usr/share/php/System.php on line 268
user1@some-instances:~# vim /usr/share/php/System.php
user1@some-instances:~# pecl install event
Fatal error: Array and string offset access syntax with curly braces is no longer supported in /usr/share/php/Console/Getopt.php on line 129
user1@some-instances:~# vim /usr/share/php/Console/Getopt.php
user1@some-instances:~# pecl install event
Fatal error: Array and string offset access syntax with curly braces is no longer supported in /usr/share/php/Console/Getopt.php on line 144
user1@some-instances:~# vim /usr/share/php/Console/Getopt.php
user1@some-instances:~# pecl install event
Fatal error: Array and string offset access syntax with curly braces is no longer supported in /usr/share/php/Console/Getopt.php on line 147
user1@some-instances:~# vim /usr/share/php/Console/Getopt.php
user1@some-instances:~# pecl install event

当时我就蒙了, 我在干什么? 我一个劲儿的vim那些老的php程序, 到底想干嘛? 堂堂一个php7.4的环境怎么报这么多错误? 后来回忆了一波history, 发现自己不小心用系统自带安装包管理工具安装过php-pear, 果断卸载。

之后就提示找不到pecl命令了, 巡视了一番, 看样子原来环境下的php没被破坏, 运行以下命令来解决

ln -s /usr/local/php/bin/pecl /usr/bin/pecl

这个时候再运行

pecl install event

解决问题

Fatal error: Array and string offset access syntax with curly braces is no longer supported

这个错误不算大事, 纯粹一个官方纠结语法所带来的问题, 把尖括号{改为方括号即可[

阅完此文,您的感想如何?
  • 有用

    43

  • 没用

    7

  • 开心

    18

  • 愤怒

    2

  • 可怜

    2

1.如文章侵犯了您的版权,请发邮件通知本站,该文章将在24小时内删除;
2.本站标注原创的文章,转发时烦请注明来源;
3.交流群: PHP+JS聊天群

相关课文
  • mac开发接入微信公众号接口返回报错 cURL error 56: SSLRead() return error -9806

  • PHP的换行符是什么

  • 由于商家传入的H5交易参数有误,该笔交易暂时无法完成,请联系商家解决

  • 阿里云控制台报dedecms注入漏洞 路径xxx/plus/search.php

我要说说
网上宾友点评
1 楼 IP 111.192.165.181 的嘉宾 说道 : 1685501680
手动编译算了