Webhook: full paths for nohup/bash in FPM environment

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-13 18:59:14 +02:00
parent 6f91bfb575
commit e81b8f8ecc
+3 -1
View File
@@ -32,7 +32,9 @@ if ($ref !== 'refs/heads/main') {
} }
// Fire-and-forget — respond immediately, deploy runs in background // Fire-and-forget — respond immediately, deploy runs in background
$cmd = 'nohup ' . escapeshellarg(DEPLOY_SCRIPT) . ' >> ' . escapeshellarg(LOG_FILE) . ' 2>&1 &'; // Use full paths to avoid PATH issues in PHP-FPM minimal environment.
$cmd = '/usr/bin/nohup /usr/bin/bash ' . escapeshellarg(DEPLOY_SCRIPT)
. ' >> ' . escapeshellarg(LOG_FILE) . ' 2>&1 &';
shell_exec($cmd); shell_exec($cmd);
echo json_encode(['ok' => true, 'deploying' => true, 'ref' => $ref]); echo json_encode(['ok' => true, 'deploying' => true, 'ref' => $ref]);