Merge pull request 'fix(cac-lsphp): enable .user.ini support (LSPHP_ENABLE_USER_INI)' (#21) from fix/lsphp-enable-user-ini into trunk
Cloud Apache Container / Build-and-Push (74) (push) Successful in 3m48s
Cloud Apache Container / Build-and-Push (80) (push) Successful in 2m32s
Cloud Apache Container / Build-and-Push (81) (push) Successful in 2m27s
Cloud Apache Container / Build-and-Push (82) (push) Successful in 3m2s
Cloud Apache Container / Build-and-Push (83) (push) Successful in 1m22s
Cloud Apache Container / Build-and-Push (84) (push) Successful in 2m25s
Cloud Apache Container / Build-and-Push (85) (push) Successful in 3m21s
Cloud Apache Container / Build-FPM-Images (74) (push) Successful in 1m36s
Cloud Apache Container / Build-FPM-Images (80) (push) Successful in 2m16s
Cloud Apache Container / Build-FPM-Images (81) (push) Successful in 2m57s
Cloud Apache Container / Build-FPM-Images (82) (push) Successful in 2m43s
Cloud Apache Container / Build-FPM-Images (83) (push) Successful in 2m40s
Cloud Apache Container / Build-FPM-Images (84) (push) Successful in 3m39s
Cloud Apache Container / Build-FPM-Images (85) (push) Successful in 2m21s
Cloud Apache Container / Build-LiteSpeed-Images (81) (push) Successful in 48s
Cloud Apache Container / Build-LiteSpeed-Images (82) (push) Successful in 1m13s
Cloud Apache Container / Build-LiteSpeed-Images (83) (push) Successful in 33s
Cloud Apache Container / Build-LiteSpeed-Images (84) (push) Successful in 1m10s
Cloud Apache Container / Build-LiteSpeed-Images (85) (push) Successful in 51s
Cloud Apache Container / Build-LSPHP-Images (81) (push) Successful in 55s
Cloud Apache Container / Build-LSPHP-Images (82) (push) Successful in 36s
Cloud Apache Container / Build-LSPHP-Images (83) (push) Successful in 30s
Cloud Apache Container / Build-LSPHP-Images (84) (push) Successful in 32s
Cloud Apache Container / Build-LSPHP-Images (85) (push) Successful in 1m22s
Cloud Apache Container / Build-Shared-httpd (push) Successful in 32s
Cloud Apache Container / Build-Shared-OLS (push) Successful in 1m20s

This commit was merged in pull request #21.
This commit is contained in:
2026-08-02 22:38:03 +00:00
2 changed files with 26 additions and 1 deletions
+6
View File
@@ -54,6 +54,12 @@ RUN bash -c 'set -e; \
cp /etc/lsws-templates/lsphp-overrides.ini "$SCAN_DIR/99-prod-overrides.ini"; \ cp /etc/lsws-templates/lsphp-overrides.ini "$SCAN_DIR/99-prod-overrides.ini"; \
echo "wrote overrides to $SCAN_DIR"' echo "wrote overrides to $SCAN_DIR"'
## php-lsapi gates .user.ini parsing behind this env var (see entrypoint-lsphp.sh
## for the full explanation). Set here so the value is visible in `docker inspect`
## and survives an entrypoint override; the entrypoint re-exports it with the same
## default so the runuser exec path can't drop it.
ENV LSPHP_ENABLE_USER_INI=on
EXPOSE 9000 EXPOSE 9000
## TCP-connect + lsphp-alive check (LSAPI isn't FastCGI, so no cgi-fcgi ping). ## TCP-connect + lsphp-alive check (LSAPI isn't FastCGI, so no cgi-fcgi ping).
+20 -1
View File
@@ -78,7 +78,26 @@ export LSAPI_EXTRA_CHILDREN="${LSAPI_EXTRA_CHILDREN:-5}"
export LSAPI_AVOID_FORK="${LSAPI_AVOID_FORK:-0}" export LSAPI_AVOID_FORK="${LSAPI_AVOID_FORK:-0}"
LSPHP_BIND="${LSPHP_BIND:-0.0.0.0:9000}" LSPHP_BIND="${LSPHP_BIND:-0.0.0.0:9000}"
echo "Container memory: ${CONTAINER_MEMORY_MB}MB | PHP_LSAPI_CHILDREN=${PHP_LSAPI_CHILDREN} | LSAPI_MAX_IDLE=${LSAPI_MAX_IDLE} | PHPVER=${PHPVER} | bind=${LSPHP_BIND}" ## ---- .user.ini support ----
## php-lsapi compiles .user.ini support in but leaves it DISABLED by default:
## sapi/litespeed/lsapi_main.c has `static int parse_user_ini = 0;` and only
## sets it in PHP_MINIT_FUNCTION(litespeed) when the PROCESS ENV contains
## LSPHP_ENABLE_USER_INI=on. Without it, lsphp never enters the user-ini chain
## at all — and does so SILENTLY, because `user_ini.filename` / `user_ini.cache_ttl`
## still report their core defaults in phpinfo(). Every other WHP PHP tier
## (cac, cac-fpm, cac-litespeed) honors .user.ini, so leaving it off here made
## the shared-ols tier quietly inconsistent: customer memory_limit /
## max_input_vars overrides were ignored, and — the reason this was found —
## Wordfence's `auto_prepend_file` WAF never loaded on ANY shared-ols site.
##
## Exported here rather than relying solely on the Dockerfile ENV because the
## runuser fallback below resets the environment; an export survives all three
## exec paths. Still overridable per-container (set LSPHP_ENABLE_USER_INI=off in
## the site's env) as an escape hatch for a site whose legacy cPanel-generated
## .user.ini has not been remediated yet.
export LSPHP_ENABLE_USER_INI="${LSPHP_ENABLE_USER_INI:-on}"
echo "Container memory: ${CONTAINER_MEMORY_MB}MB | PHP_LSAPI_CHILDREN=${PHP_LSAPI_CHILDREN} | LSAPI_MAX_IDLE=${LSAPI_MAX_IDLE} | PHPVER=${PHPVER} | bind=${LSPHP_BIND} | user_ini=${LSPHP_ENABLE_USER_INI}"
## ---- per-site ini drop-ins (identical mechanism to entrypoint-litespeed.sh) ---- ## ---- per-site ini drop-ins (identical mechanism to entrypoint-litespeed.sh) ----
## error_log → the same customer-visible path cac:phpNN / cac-litespeed use, so ## error_log → the same customer-visible path cac:phpNN / cac-litespeed use, so