Error while starting PHP-FPM: PHP-FPM failed to start

2024-09-29

エラー内容

{"name":"502","$fault":"client","$metadata":{"httpStatusCode":502,"attempts":3,"totalRetryDelay":130},"errorMessage":"Error while starting PHP-FPM: PHP-FPM failed to start","errorType":"RuntimeException","stackTrace":["#0 /opt/bref/bootstrap.php(17): Bref\\FpmRuntime\\Main::run()","#1 {main}"],"message":"UnknownError"}

詳細

Bref\FpmRuntime\Main::run()::39にvar_dump($e);exit;を入れた

api-1  | [04-Oct-2024 15:03:58] ERROR: unable to bind listening socket for address '/tmp/.bref/php-fpm.sock': Operation not supported (95)
api-1  | [04-Oct-2024 15:03:58] ERROR: FPM initialization failed
api-1  | object(Exception)#22 (7) {
api-1  |   ["message":protected]=>
api-1  |   string(23) "PHP-FPM failed to start"
api-1  |   ["string":"Exception":private]=>
api-1  |   string(0) ""
api-1  |   ["code":protected]=>
api-1  |   int(0)
api-1  |   ["file":protected]=>
api-1  |   string(56) "/var/task/vendor/bref/bref/src/FpmRuntime/FpmHandler.php"
api-1  |   ["line":protected]=>
api-1  |   int(219)
api-1  |   ["trace":"Exception":private]=>
api-1  |   array(3) {
api-1  |     [0]=>
api-1  |     array(6) {
api-1  |       ["file"]=>
api-1  |       string(56) "/var/task/vendor/bref/bref/src/FpmRuntime/FpmHandler.php"
api-1  |       ["line"]=>
api-1  |       int(90)
api-1  |       ["function"]=>
api-1  |       string(14) "waitUntilReady"
api-1  |       ["class"]=>
api-1  |       string(26) "Bref\FpmRuntime\FpmHandler"
api-1  |       ["type"]=>
api-1  |       string(2) "->"
api-1  |       ["args"]=>
api-1  |       array(0) {
api-1  |       }
api-1  |     }
api-1  |     [1]=>
api-1  |     array(6) {
api-1  |       ["file"]=>
api-1  |       string(50) "/var/task/vendor/bref/bref/src/FpmRuntime/Main.php"
api-1  |       ["line"]=>
api-1  |       int(37)
api-1  |       ["function"]=>
api-1  |       string(5) "start"
api-1  |       ["class"]=>
api-1  |       string(26) "Bref\FpmRuntime\FpmHandler"
api-1  |       ["type"]=>
api-1  |       string(2) "->"
api-1  |       ["args"]=>
api-1  |       array(0) {
api-1  |       }
api-1  |     }
api-1  |     [2]=>
api-1  |     array(6) {
api-1  |       ["file"]=>
api-1  |       string(23) "/opt/bref/bootstrap.php"
api-1  |       ["line"]=>
api-1  |       int(17)
api-1  |       ["function"]=>
api-1  |       string(3) "run"
api-1  |       ["class"]=>
api-1  |       string(20) "Bref\FpmRuntime\Main"
api-1  |       ["type"]=>
api-1  |       string(2) "::"
api-1  |       ["args"]=>
api-1  |       array(0) {
api-1  |       }
api-1  |     }
api-1  |   }
api-1  |   ["previous":"Exception":private]=>
api-1  |   NULL
api-1  | }

解決方法

mkdir -p /var/run/php/

参考