Bug: PHP 5.6 runtime extension build for ionCube always fails — install-ext checks wrong module name ($1 vs $2)

未关闭
#14,324 0 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@wanghe-fit2cloud 已经在做这个了。

开始于 2026年11月9日。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
52/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
docker, php, shell
领域
backend, devops

调研方向

Start with the PHP 5 app recipe at /opt/1panel/resource/apps/remote/php/5/build/data/install-ext and inspect install_php_extensions() alongside the ionCube call that passes ionCube Loader. Compare the check against the module name shown by php -m; the report also flags a separate loader compatibility concern for PHP 5.6. Done means the wrapper reports successful installation when the installed module is present, with the PHP 5.6 loader behavior addressed or clearly scoped.

由索引模型根据 Issue 内容生成。

描述

Bug: PHP runtime extension install can never succeed for ionCube on PHP 5.6 patched images (name mismatch in install-ext)

Environment

  • 1Panel v2.4.2 (OSS), Debian 13 x86_64, Docker
  • Runtime: App Store PHP runtime legacy-php5661, image 1panel/php:5.6.41-fpm + 1Panel install-ext layer
  • Extension: ionCube (build recipe for the 5/x app: /opt/1panel/resource/apps/remote/php/5/build/data/install-ext)
Steps to reproduce
  1. Create a PHP 5.6.x runtime from the App Store with the ionCube extension selected (or install the extension afterwards from Websites → Runtimes → PHP → Extension → ionCube).
  2. The extension build starts install-php-extensions ioncube_loader and reports failure every time, regardless of network state or retries (/opt/1panel/log/task/RuntimeExtension/<id>.log ends with ------ install-php-extensions ioncube_loader failed ------, then [TASK END] failure).
Root cause

The app template wrapper only checks success by re-grepping php -m for the wrapper argument, not by the module's real name:

install_php_extensions() {
    local extension=$1
    install-php-extensions $extension
    if is_extension_installed "$extension"; then   # ← checks "$extension"
  • install-php-extensions ioncube_loader succeeds and enables zend_extension=ioncube_loader.so; php -m then lists the module as
    ionCube Loader (with a space)
  • is_extension_installed "ioncube_loader" does php -m | grep -q '^ioncube_loader$' → never matches → wrapper exits 1 → whole install marked failed
  • Note the second parameter ("ionCube Loader") that the call site passes on line 313 (install_php_extensions ioncube_loader "ionCube Loader") is ignored by install_php_extensions() — it looks like the wrapper was meant to verify with the display name.

Verified directly: running the identical install-php-extensions ioncube_loader by hand inside the same image exits 0 and enables the loader; only the wrapper's is_extension_installed gate declares failure. The task failure then aborts the whole image build, so the runtime never receives ionCube.

Suggested fix

In install_php_extensions() (all PHP app-recipe install-ext files), verify against the loaded extension name rather than the wrapper argument, e.g.:

install_php_extensions() {
    local extension=$1
    local check_name=${2:-$extension}
    install-php-extensions $extension
    if is_extension_installed "$check_name"; then   # "ionCube Loader" for ionCube

or normalise the php -m output (strip whitespace/case) before comparing.

Actual observed behaviour on 5.6
  • Install always fails at the "check" stage (exit 1), no image produced, runtime untouched.
  • Rejected hashes of md5(apiKey.action.user.pass) also surface later when the operator installs a loader manually — but that is the vendor-side inet-cash protocol, not 1Panel's issue; keeping it short here.

Happy to attach the full RuntimeExtension task log + php -i fragments if useful.

Secondary finding (same build path, for completeness)

Even with the wrapper fixed, the ionCube build for the patched PHP 5.6 runtime is not safe by default: the loader install-php-extensions fetches ("latest", v15.5.1) segfaults FPM workers on PHP 5.6.40/5.6.41 (custom builds) whenever a deeply-encoded script runs — pool dies in a SIGSEGV loop (verified on both the vendor image and the patched 1Panel image, with plain CLI php -l passing). The 10.2.4 loader (2018 archive) runs the identical workload clean. Recommend pinning a known-good loader for 5.6, or at least testing an encoded file inside FPM in the build, before shipping the loader.

主要语言
Go
星标
37.4k
派生
3.4k
平均合并
8 小时 5 分钟
30 天内合并 PR
176

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

1Panel-dev/1Panel 的其他 Issue

查看 1Panel-dev/1Panel 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。