宝塔安装php7以上的版本都失败(Ubuntu 22.04.1)

原因:安装了宝塔纯净版之后,只能安装php 7.0。宝塔纯净版可能用了aapanel的代码,然而 aapanel 又不支持 Ubuntu 22,只支持 Ubuntu 20。
导致,php 7.1 及之后的 php 版本都无法安装。

狂雨CMS 只支持 php7.2,不支持 php7.4。(php7.4报错,Array and string offset access syntax with curly braces is deprecated)

同样的原因,也此版本安装mysql5.5 以上版本都失败,只能安装mysql 5.5

解决方案:先用宝塔官方版本,安装php7.x 或者 8.x,再破解宝塔,安装纯净版。可以把常用的php版本都安装上。

安装失败的log

/www/server/php/74/src/ext/intl/breakiterator/breakiterator_class.cpp:23:
/www/server/php/74/src/ext/intl/breakiterator/codepointiterator_internal.h:42:31: error: conflicting return type specified for ‘virtual UBool PHP::CodePointBreakIterator::operator==(const icu_70::BreakIterator&) const’
   42 |                 virtual UBool operator==(const BreakIterator& that) const;
      |                               ^~~~~~~~
In file included from /www/server/php/74/src/ext/intl/breakiterator/breakiterator_class.cpp:21:
/usr/include/unicode/brkiter.h:127:18: note: overridden function is ‘virtual bool icu_70::BreakIterator::operator==(const icu_70::BreakIterator&) const’
  127 |     virtual bool operator==(const BreakIterator&) const = 0;
      |                  ^~~~~~~~
make: *** [Makefile:1164: ext/intl/breakiterator/breakiterator_class.lo] Error 1
========================================================
Ubuntu 22.04.1 LTS 
 \l
Bit:64 Mem:23988M Core:4 gcc:11.2.0 cmake:3.22.1
Linux 5.15.0-1021-oracle aarch64
ERROR: php-7.4.21 install failed.

Leave a Reply