Bug Report: mbstring.sh — Hardcoded PHP 8.3 path blocks installation on other versions
Script URL: https://node.aapanel.com/install/3/mbstring.sh
Bug location: Lines 43–48 of Install_mbstring()
Current (buggy) code:
isInstall=cat /www/server/php/$version/etc/php.ini|grep '\/mbstring.so'
PHPM_CHECK=$(/www/server/php/83/bin/php -m|grep mbstring) # ← BUG: hardcoded '83'
if [ "${isInstall}" != "" ] || [ "${PHPM_CHECK}" ];then
echo "php-$vphp 已安装过mbstring,请选择其它版本!"
echo "php-$vphp not install, Plese select other version!"
return
fi
Two issues:
Hardcoded PHP 8.3 path — PHPM_CHECK=$(/www/server/php/83/bin/php -m|grep mbstring) uses a hardcoded 83 instead of
$version. When installing for PHP 8.4 or 8.5, it checks the wrong PHP binary.
php -m check can't distinguish static vs shared — even when fixed to use $version, php -m returns mbstring if the
extension is compiled statically (via --enable-mbstring). Since newer aaPanel PHP builds compile mbstring statically,
the install check always thinks it's "already installed" and refuses to install the shared .so, even though the shared
module file doesn't exist — causing the panel UI to show "not installed" while the install script says "already
installed" (contradiction).
Suggested fix:
isInstall=cat /www/server/php/$version/etc/php.ini|grep '\/mbstring.so'
if [ "${isInstall}" != "" ] && [ -f "${extFile}" ];then
echo "php-$vphp 已安装过mbstring,请选择其它版本!"
echo "php-$vphp mbstring already installed, Plese select other version!"
return
fi
This checks both the ini reference AND the actual .so file existence — a proper shared-install check that doesn't
conflict with statically-compiled mbstring. The same fix applies to any other extension scripts that use the same php
-m pattern (check imap.sh, exif.sh, etc. for similar issues).
Reproduced on: aaPanel / PHP 8.5
---