Repository navigation
Conversation
…abled On PHP 8 a function listed in disable_functions is removed, so the unconditional pcntl_signal() calls in the EE_Site_Command constructor were a fatal "Call to undefined function" for every ee site command on hosts whose CLI php.ini disables pcntl_* (HestiaCP does this; EasyEngine/easyengine#1956). A PHP built without pcntl failed the same way. pcntl_signal() and pcntl_signal_dispatch() are now called only when they exist. Without them a site command still runs; it only loses the rollback on SIGINT/SIGTERM/SIGHUP/SIGUSR1 (logged as a debug line), and Ctrl+C still ends the SSL lock wait because the default signal action applies. With pcntl available nothing changes. ee site share now refuses up front with a clear error when shell_exec() is disabled, instead of a fatal after the old share was already torn down; a plain --disable still works.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of EasyEngine/easyengine#1956, companion to EasyEngine/easyengine#1957.
Problem
On PHP 8 a function listed in
disable_functionsis removed, and calling it is a fatalCall to undefined function. TheEE_Site_Commandconstructor calledpcntl_signal()unconditionally, so on a host whose CLIphp.inidisablespcntl_*(HestiaCP does) everyee site …command died:A PHP built without pcntl failed the same way, and
pcntl_signal_dispatch()in the SSL lock wait had the same problem.Change
pcntl_signal()andpcntl_signal_dispatch()are called only when they exist. Without them a site command still runs; it only loses the rollback on SIGINT/SIGTERM/SIGHUP/SIGUSR1, which is logged as a debug line. Ctrl+C still ends the SSL lock wait, because the default signal action applies when no handler is installed. With pcntl available nothing changes (same handlers, same order).function_exists( 'pcntl_signal' )also keeps theSIG*constants from being evaluated when the extension isn't loaded.ee site sharerefuses up front with a clear error whenshell_exec()is disabled, instead of a fatal after the existing share was already torn down. A plain--disable(curl andkillallonly) still works.Why pcntl is optional
The signal handlers only add a rollback when a command is interrupted, which is a nice-to-have compared with not being able to run any site command. So the core check (EasyEngine/easyengine#1957) treats
pcntl_signal,pcntl_signal_dispatchandshell_execas optional and only refuses on what ee can't work without. The other unguarded calls the audit found here (posix_*in site types,php_uname,getmypid,disk_free_space,curl_*,openssl_*,chown,symlink,gethostname) are needed by site create, SSL, backup and clone, so they stay required and core refuses up front with an error that names them.Merge order
Merge and tag this first, then core: the core PR relies on this guard for HestiaCP hosts.
Tests
ubuntu:24.04, ondrej PHP 8.3 and 7.4, HestiaCP's own CLIdisable_functionsline, Docker stubbed): before,ee site list/ee site createare a fatal on PHP 8.3; after, they run (No sites found!, site creation proceeds).Call to undefined function pcntl_signal().disable_functionson 7.4, 8.3 and 8.5.