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

Đang mở
#14,324 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@wanghe-fit2cloud đang làm issue này rồi.

Từ ngày 9/11/2026.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
52/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
docker, php, shell
Lĩnh vực
backend, devops

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Go
Star
37.4k
Fork
3.4k
Merge trung bình
8 giờ 5 phút
Pull request đã merge (30 ngày)
176

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của 1Panel-dev/1Panel

Tất cả issue của 1Panel-dev/1Panel

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.