Repository navigation
Conversation
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.
Summary
Fixes a PHP-FPM worker state poisoning bug observed while validating
infrascielo/metodologia:v7.14-qaon SciELO Paraguay staging (PHP 8.5.12):docker/rocky9/httpd-scielo.confsets:proxy:unix:/run/php-fpm/www.sock|fcgi://localhost/,PHP_ADMIN_VALUEoverwritesauto_prepend_filefor the lifetime of that PHP-FPM worker process across subsequent requests (pm.max_requests = 250). After Docker's periodicHEALTHCHECKhits/health.phpa few times (pm.max_children = 8), all PHP-FPM workers stop loadinghtdocs/compat.php, causing endpoints that rely oncompat.php(sendMail.php,articleRequestGraphicPage.php, and legacycompat.phppolyfills) to fail withHTTP 500(Call to undefined function scielo_utf8_encode()).Changes
docker/rocky9/compat-prepend.php+docker/rocky9/php-scielo.ini+docker/rocky9/Dockerfile:Install
/opt/scielo-health/compat-prepend.php(copied andphp -lchecked during image build) and setauto_prepend_file = /opt/scielo-health/compat-prepend.php. It loads/var/www/html/htdocs/compat.phponly when it exists andSCRIPT_FILENAME !== '/opt/scielo-health/health.php', preserving/health.phpindependence for older mounted trees without mutating worker INI state.docker/rocky9/httpd-scielo.conf:Remove
<Location "/health.php"> SetEnv PHP_ADMIN_VALUE "auto_prepend_file=" </Location>.htdocs/applications/scielo-org/users/functions.php:Add a defensive
SCIELO_COMPAT_LOADEDrequire_onceforhtdocs/compat.php(matching the existing pattern inhtdocs/oai/scielo-oai.phpandhtdocs/classMySQLDatabase.php) for standalone/non-container deployments.tests/security_regression.php:Add regression checks verifying
httpd-scielo.confdoes not setauto_prepend_file=andphp-scielo.inireferences/opt/scielo-health/compat-prepend.php.Verification
php -l /opt/scielo-health/compat-prepend.php->No syntax errors detected/opt/httpd/bin/httpd -d /etc/httpd -f conf/httpd.conf -t->Syntax OKphp /var/www/html/tests/security_regression.phpinsidev7.14-qastaging container ->Security regression tests passed/health.php12 times (HTTP 200), then verifiedsendMail.phpandarticleRequestGraphicPage.phpacross 8 consecutive requests (HTTP 200on all 8/8 vsHTTP 500before the fix).