Upgrade Guide
Most PAM upgrades are a single command. Patch releases are compatible by design, but some 2.2.x patches deliberately changed a default to close a security gap. This guide lists every one of those changes, newest first, with an estimate of how likely it is to affect you:
- High impact: most applications must change something.
- Medium impact: applications that use the feature must check it.
- Low impact: only unusual setups notice.
Upgrading PAM
Section titled “Upgrading PAM”Updating the Runtime
Section titled “Updating the Runtime”pam self-update downloads a release authorized by PAM’s pinned distribution
identity and verifies it before switching:
pam self-update --check # report a newer verified release, change nothingpam self-update # install the latest releasepam self-update v2.2.27 # install one exact releasepam --versionpam doctorDowngrades are refused unless you authorize exactly one older version:
pam self-update v2.2.26 --allow-downgradeYou can also pin a version with the installer, which is useful in Dockerfiles and CI images:
curl -fsSL https://github.com/push-in/pam/releases/latest/download/install.sh \ | PAM_VERSION=v2.2.27 shUpdating Packages
Section titled “Updating Packages”Composer packages such as Nimbus, Arcano, and the PAM Native SDK are versioned independently of the runtime. Update them with PAM’s Composer:
pam composer outdated --directpam composer update pushinbr/nimbus pushinbr/arcano --with-dependenciespam testA Safe Upgrade Checklist
Section titled “A Safe Upgrade Checklist”- Run your test suite on the current version with
pam test. - Read every section below between your version and the target version.
- Upgrade a staging host first and run
pam doctor. - Restart or reload the cluster, then check
pam psandpam logs(see Process Management). - Keep the previous release available with
--allow-downgradeuntil you are confident.
Upgrading to 2.2.27 From 2.2.26
Section titled “Upgrading to 2.2.27 From 2.2.26”Underscore Headers Stay Out of $_SERVER
Section titled “Underscore Headers Stay Out of $_SERVER”Likelihood of impact: Low
Request headers whose names contain _ no longer appear in $_SERVER. This
prevents a client-sent X-Forwarded_For from overwriting the
HTTP_X_FORWARDED_FOR value a proxy set, matching nginx’s
underscores_in_headers off.
If your application reads such a header, read it from the request’s header list instead, where it is still present:
// Before: $_SERVER['HTTP_X_CUSTOM_TOKEN'] for a header named "X_Custom_Token"$token = $request->getHeader('X_Custom_Token');Errors Are No Longer Displayed by Default
Section titled “Errors Are No Longer Displayed by Default”Likelihood of impact: Medium
In server mode display_errors is now off and log_errors is on, unless you set
the exposeErrors server option. expose_php also defaults to off. Without a
php.ini, older releases printed warnings, including file paths, into responses.
Warnings now go to the worker log. During local development you can opt back in:
$server->listen(8080, '127.0.0.1', [ 'exposeErrors' => true, // development only]);Bounded Connections per Worker
Section titled “Bounded Connections per Worker”Likelihood of impact: Low
A worker now serves at most maxConnections connections. The default is the open
file limit minus 256 descriptors reserved for PHP. Past the limit, the worker stops
accepting until a connection closes, instead of running out of descriptors. Raise
the process file limit (ulimit -n) if you serve many idle keep-alive or WebSocket
connections per worker.
New Template Constraints
Section titled “New Template Constraints”Likelihood of impact: Low
Projects created with pam init now require pushinbr/nimbus ^0.7 and
pushinbr/arcano ^0.2.9. Existing projects are not changed; see
Upgrading Nimbus below.
Upgrading to 2.2.26 From 2.2.25
Section titled “Upgrading to 2.2.26 From 2.2.25”Client Address Behind a Trusted Proxy
Section titled “Client Address Behind a Trusted Proxy”Likelihood of impact: Medium
Behind a trusted proxy, the client address is now the rightmost
X-Forwarded-For entry that is not a trusted proxy, not the leftmost entry (which
the client controls). Entries must be IP addresses. This value feeds
$_SERVER['REMOTE_ADDR'] and rateLimitPerSecond.
trustedProxies accepts CIDR ranges, and the PAM_TRUSTED_PROXIES environment
variable (comma separated) adds to it without a code change:
$server->listen(8080, '0.0.0.0', [ 'trustedProxies' => ['10.0.0.0/8', '192.168.1.10'],]);PAM_TRUSTED_PROXIES=10.0.0.0/8,172.16.0.0/12 pam start index.phpIf you list every hop of a multi-proxy chain, the result is unchanged. If you only
listed the last proxy and expected the leftmost address, add the inner proxies too.
* still trusts every peer and logs a warning at boot.
/metrics Answers Loopback Only
Section titled “/metrics Answers Loopback Only”Likelihood of impact: Medium
A worker’s metricsPath (/metrics by default) now answers only loopback peers,
and not a loopback request that carries X-Forwarded-For, Forwarded, or
X-Real-IP (that is, a reverse proxy on the same host). Other peers reach your
application’s own route.
If Prometheus scrapes from another host, choose one option:
PAM_METRICS_TOKEN="$(openssl rand -hex 32)" pam start index.phpConfigure the scraper to send Authorization: Bearer <token>. The metricsToken
server option does the same in code.
PAM_METRICS_PUBLIC=1 pam start index.phpOnly do this on a private network. The metricsPublic server option does the same
in code.
Cross-Site WebSocket Upgrades Are Refused
Section titled “Cross-Site WebSocket Upgrades Are Refused”Likelihood of impact: Medium
A /ws upgrade from another site’s page (an Origin that is neither listed nor
the request’s own host) now gets 403. This stops a page elsewhere from opening a
socket with the user’s cookies. Clients that send no Origin header (servers,
mobile apps, CLI tools) are unaffected.
If your frontend is served from a different origin, list it:
$server->listen(8080, '0.0.0.0', [ 'websocketOrigins' => ['https://app.example.com'],]);PAM_WEBSOCKET_ORIGINS does the same from the environment. When
websocketOrigins is empty, corsOrigins is used.
Bounded Request Bodies per Worker
Section titled “Bounded Request Bodies per Worker”Likelihood of impact: Low
Request bodies held by PHP are now bounded per worker by maxInflightBodyBytes.
The default is a quarter of memory_limit; 0 disables the limit and
PAM_MAX_INFLIGHT_BODY_BYTES overrides it. A request over the budget waits up to
requestTimeoutMs, then gets 503 with Retry-After. Applications that accept
many large concurrent uploads may need a higher memory_limit or more workers.
Request IDs Are Labels
Section titled “Request IDs Are Labels”Likelihood of impact: Low
A client’s X-Request-Id is now only a correlation label (response header, access
log, $_SERVER['PAM_REQUEST_ID']). The worker always generates the dispatch key.
Do not rely on X-Request-Id being unique.
Upgrading to 2.2.25 From 2.2.24
Section titled “Upgrading to 2.2.25 From 2.2.24”HTTP/1 on the PHP Thread
Section titled “HTTP/1 on the PHP Thread”Likelihood of impact: Low
Plain HTTP/1 connections are now served on the PHP worker thread, with no hop to an I/O thread. TLS connections keep the I/O thread. Streamed responses and SSE flush each chunk before PHP runs again. If you measured better results with the previous mode, restore it:
PAM_IO_THREADS=1 pam start index.phpPAM_IO_THREADS accepts 1 to 16.
Upgrading to 2.2.24 From 2.2.23
Section titled “Upgrading to 2.2.24 From 2.2.23”Likelihood of impact: Low
- Fiber C stacks are pooled (up to 8 per worker; only memory is reused, never
Fiber or PHP state). Set
PAM_FIBER_STACK_POOL=0to disable the pool. DateTimeInterface::format(DATE_ATOM)runs in C. SetPAM_FAST_DATE_FORMAT=0if you need the PHP implementation.
Upgrading to 2.2.15 From 2.2.14
Section titled “Upgrading to 2.2.15 From 2.2.14”Likelihood of impact: Low
The post-boot prefork zygote (PAM_PREFORK_BOOT=app) boots your application once
and forks workers from the booted state. It is the default for
artisan pam:octane. Sockets left open after boot are disconnected before the
first fork, and inherited files are reopened per worker. If your framework keeps
other per-process resources, reset them with the fork hooks:
\Pam\Fork::beforeFork(static function (): void { // close connections opened during boot});
\Pam\Fork::afterFork(static function (): void { // reconnect or reseed per worker});See Memory & State for what survives between requests.
Upgrading to 2.2.14 From 2.2.13
Section titled “Upgrading to 2.2.14 From 2.2.13”--max-requests Is a Ceiling
Section titled “--max-requests Is a Ceiling”Likelihood of impact: Low
The per-worker stagger now lowers limits to between 75% and 100% of
--max-requests, instead of raising them by up to 25%. If you sized
--max-requests to the exact point where a memory leak becomes a problem, you now
get recycling slightly earlier, never later.
Upgrading to 2.2.12 From 2.2.11
Section titled “Upgrading to 2.2.12 From 2.2.11”System Timezone by Default
Section titled “System Timezone by Default”Likelihood of impact: Low
date.timezone now defaults to the system zone (TZ, then the /etc/localtime
link) instead of PHP’s UTC fallback. Set it explicitly if your application
assumes UTC:
TZ=UTC pam start index.phppam -d date.timezone=UTC index.phpUpgrading to 2.2.10 From 2.2.9
Section titled “Upgrading to 2.2.10 From 2.2.9”Prefork Workers
Section titled “Prefork Workers”Likelihood of impact: Low
On Linux with more than one worker, a zygote starts the Zend Engine and
OPcache/JIT once and forks workers before any PHP code runs, so workers share one
OPcache segment. PAM_PREFORK=0 keeps the previous exec-per-worker model.
Least-connections balancing between workers can be disabled with PAM_BALANCE=0.
Package Command Scripts Must Live in Their Package
Section titled “Package Command Scripts Must Live in Their Package”Likelihood of impact: Low
Package commands are now bounded by the resolved package directory, so Composer path repositories installed as symlinks work. A package that pointed a command at a script outside its own directory must move that script into the package. See Package Commands.
Upgrading to 2.x From 1.x
Section titled “Upgrading to 2.x From 1.x”The 2.0.0 release did not remove public runtime APIs. It changed how releases are
certified (every official package runs on PHP 8.4 and 8.5 against its newest and
lowest dependency graphs) and added pam support and OTLP span export. To move
from 1.x:
- Install the latest 2.2.x release with
pam self-update. - Run
pam doctorin each project and apply suggested repairs withpam doctor --fix. - Make sure your project targets PHP 8.5. PAM bundles PHP 8.5 by default and
new projects require
^8.5; PHP 8.4 stays available only for explicit compatibility matrices. - If you use
pushinbr/pam-http, migrate to Nimbus (next section). If you use Laravel Octane, updatepushinbr/pam-octaneand read Laravel on PAM. - Read every 2.2.x section above. The changes most likely to need action are the
/metricsrestriction, cross-site WebSocket origins, and trusted proxies.
Upgrading Nimbus
Section titled “Upgrading Nimbus”From pam-http to Nimbus
Section titled “From pam-http to Nimbus”Nimbus replaces pushinbr/pam-http, which stays frozen at 2.2.x and receives no
new features. The runtime classes keep their names, so most of the work is
renaming namespaces:
-
Swap the package:
Terminal window pam composer remove pushinbr/pam-httppam composer require pushinbr/nimbus -
Replace namespaces:
Pam\Api\becomesNimbus\, andPam\AppbecomesNimbus\App.Pam\Http\RequestandPam\Http\Responseare unchanged. -
Move route declarations into
routes.phpand load it from your application:bootstrap/app.php $app = new Nimbus\App();$app->routes(__DIR__ . '/../routes.php');return $app;routes.php use App\Controllers\PingController;/** @var Nimbus\RouteRegistrar $router */$router->get('api/ping', [PingController::class, 'show']); -
Use Arcano for the database (
ArcanoServiceProvider). Nimbus has no other ORM integration and noilluminate/*dependencies.
Porting from Laravel instead? The pushinbr/nimbus-rector package ships the
NimbusSetList::LARAVEL_TO_NIMBUS Rector set for the mechanical part.
Nimbus 0.7
Section titled “Nimbus 0.7”Likelihood of impact: Medium for applications using social login or e-mail verification.
- Social login binds the OAuth state to the client that started it: the start
route sets an HttpOnly,
SameSite=Laxnimbus_oauth_statecookie, and the callback refuses a state without it.bindStateToClient: falseturns it off. - E-mail verification tokens are bound to the address they were sent to. Links sent before the upgrade stop working; users must request a new one.
- Storage uploads of HTML, SVG, XML, or script types are refused with
415unless you passallowActiveContent: true.
Nimbus 0.6
Section titled “Nimbus 0.6”Likelihood of impact: High for applications using tokens, the admin panel, CORS, or password resets.
- The bare
*token scope no longer satisfies a Gate ability that has neither a definition nor a policy. Define your abilities, or call$app->gate()->wildcardScopesGrantUndefinedAbilities()to restore the old behaviour. - The admin panel answers
403until you defineviewAdmin(for example$app->gate()->define('viewAdmin', ...)) or register abefore()hook. CorsMiddlewarethrows when'*'is combined withcredentials: true.PasswordResetsmust be constructed withrevoke:orafterReset:. Pass the credentials to revoke on reset, orrevoke: []to opt out.- Nimbus 0.6 requires
pushinbr/arcano^0.2.8.
Nimbus’s full deprecation policy and the per-release changelog live in the Nimbus repository.