Skip to content

Commit

Permalink
Enable running as root to support Lambda contexts
Browse files Browse the repository at this point in the history
Otherwise PHP-FPM can’t read/write artifacts in /tmp which it may need.
  • Loading branch information
onethumb committed Jun 6, 2024
1 parent 7507bb3 commit be7b822
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/FpmRuntime/FpmHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,20 @@ public function start(): void
}

/**
* --allow-to-run-as-root: in a Lambda context, we need to run as root
* --nodaemonize: we want to keep control of the process
* --force-stderr: force logs to be sent to stderr, which will allow us to send them to CloudWatch
*/
$this->fpm = new Process(['php-fpm', '--nodaemonize', '--force-stderr', '--fpm-config', $this->configFile]);
$this->fpm = new Process(
[
'php-fpm',
'--allow-to-run-as-root',
'--nodaemonize',
'--force-stderr',
'--fpm-config',
$this->configFile

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.

Check failure on line 87 in src/FpmRuntime/FpmHandler.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Multi-line arrays must have a trailing comma after the last element.
]
);

$this->fpm->setTimeout(null);
$this->fpm->start(function ($type, $output): void {
Expand Down

0 comments on commit be7b822

Please sign in to comment.