heroku / heroku-buildpack-php

Heroku's buildpack for PHP applications.

Home Page:https://devcenter.heroku.com/categories/php

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PHP-FPM Worker Process Configuration Error, Fractional Worker Count Issue

arshad853 opened this issue · comments

Hi,
After New formula for determining number of PHP-FPM worker processes updates creating issue with the php code deploy to server.
PHP-FPM Initialization Failure Due to Invalid Worker Process,
Syntax error occurring in the PHP-FPM configuration file, where a value for the number of worker processes (pm.max_children) is expected but is not provided in a valid format.
Additionally, the error points out an attempt to use a fractional value (e.g., 4.5 workers), which is not supported as the number of worker processes must be a whole number.
FPM configration file.
php_value[memory_limit] = 2048M
php_value[max_execution_time] = 300
request_terminate_timeout = 350

Sharing some logs that i am facing:

Start of container output (web.5)        
DOCUMENT_ROOT changed to '..../'        
Using PHP-FPM configuration include 'fpm_custom.conf'        
Available RAM is 9007199254740988K Bytes        
Number of CPU cores is 1        
 PHP memory_limit is 2048M Bytes        
vendor/bin/heroku-php-apache2: line 434: [[: 4.5: syntax error: invalid arithmetic operator (error token is ".5")        
Starting php-fpm with 4.5 workers...        
ERROR: [/conf/php/8/php-fpm.conf :258] unable to parse value for entry 'pm.max_children': is not a valid number (greater or equal than zero)        
ERROR: failed to load configuration file '/conf/php/8/php-fpm.conf'        
ERROR: FPM initialization failed        
Process exited unexpectedly: php-fpm, shutting down...        
Shutdown complete.        
DOCUMENT_ROOT changed to '.../'        
Using PHP-FPM configuration include 'fpm_custom.conf'        
Available RAM is 9007199254740988K Bytes        
Number of CPU cores is 1        
PHP memory_limit is 2048M Bytes        
vendor/bin/heroku-php-apache2: line 434: [[: 4.5: syntax error: invalid arithmetic operator (error token is ".5")        
Starting php-fpm with 4.5 workers...        
ERROR: [./conf/php/8/php-fpm.conf :258] unable to parse value for entry 'pm.max_children': is not a valid number (greater or equal than zero)        
ERROR: failed to load configuration file './conf/php/8/php-fpm.conf'        
ERROR: FPM initialization failed        
Process exited unexpectedly: php-fpm, shutting down...        
Shutdown complete.        
DOCUMENT_ROOT changed to '.../'        
Using PHP-FPM configuration include 'fpm_custom.conf'        
Available RAM is 9007199254740988K Bytes        
Number of CPU cores is 1        
PHP memory_limit is 2048M Bytes        
/heroku-php-apache2: line 434: [[: 4.5: syntax error: invalid arithmetic operator (error token is ".5")        
Starting php-fpm with 4.5 workers...        
ERROR: [./conf/php/8/php-fpm.conf :258] unable to parse value for entry 'pm.max_children': is not a valid number (greater or equal than zero)        
ERROR: failed to load configuration file './conf/php/8/php-fpm.conf'        
ERROR: FPM initialization failed        
Process exited unexpectedly: php-fpm, shutting down...        
Shutdown complete.        
DOCUMENT_ROOT changed to '/'        
Using PHP-FPM configuration include 'fpm_custom.conf'        
Available RAM is 9007199254740988K Bytes        
Number of CPU cores is 1        
PHP memory_limit is 2048M Bytes        
/heroku-php-apache2: line 434: [[: 4.5: syntax error: invalid arithmetic operator (error token is ".5")        
Starting php-fpm with 4.5 workers...        
ERROR: [./conf/php/8/php-fpm.conf:258] unable to parse value for entry 'pm.max_children': is not a valid number (greater or equal than zero)        
ERROR: failed to load configuration file './conf/php/8/php-fpm.conf'        
ERROR: FPM initialization failed        
Process exited unexpectedly: php-fpm, shutting down...        
Shutdown complete.        
2024/02/06 13:19:32 signal: terminated

Yup, already fixed in #688, to be merged soon.