Troubleshooting & FAQ
Start every investigation with the same three commands from the project root:
pam --versionpam doctorpam artisan aboutThen find your symptom below.
Troubleshooting
Section titled “Troubleshooting”The Worker Exits With “Laravel requires maxConcurrentRequests=1”
Section titled “The Worker Exits With “Laravel requires maxConcurrentRequests=1””pam.php passes a value other than 1. Laravel’s facades and managers are
process-global, so PAM refuses to run two Laravel requests in one worker. Set
'maxConcurrentRequests' => 1 and raise --workers instead.
Code Changes Do Not Show Up
Section titled “Code Changes Do Not Show Up”pam start runs OPcache with validate_timestamps=0. Reload the cluster:
kill -HUP <master-pid> # or: systemctl reload example-appIn development, use pam dev pam.php, which restarts on every change. If you
cached config or routes, rebuild them first (pam artisan optimize).
A User Sees Another User’s Data
Section titled “A User Sees Another User’s Data”Something keeps request data between requests. Look for:
- a singleton built from
request(),auth()->user(), or the tenant, resolved during boot; - a static property assigned per request; and
- a package with a static cache keyed by user.
Reproduce with one worker (--workers 1), alternate users, and turn on
PAM_LARAVEL_STATE_GUARD_STRICT=true. See
Request Lifecycle.
Memory Keeps Growing
Section titled “Memory Keeps Growing”Measure one worker with the persistent smoke test.
Common causes: static arrays that grow per request, event listeners registered
inside a request, and debug tools (Telescope, Debugbar) collecting data in
production. As a safety net, set --max-requests from the measured growth.
Requests Hang or Time Out With 504
Section titled “Requests Hang or Time Out With 504”The worker is blocked (slow query, external HTTP call, sleep). A request
that passes requestTimeoutMs (30 s by default) receives 504 and the worker
is replaced. Add workers to cover I/O wait, add timeouts to HTTP clients, and
move slow work to queues.
The Response Is a 500 With “The request failed”
Section titled “The Response Is a 500 With “The request failed””Check the worker log: PAM writes one JSON line per failed request with a
requestId. If the line says a PHP fatal error left the engine unusable; recycling this worker, the code called exit()/die() or hit a fatal error;
PAM replaced the worker. Set APP_DEBUG=true locally to see the exception.
Large Uploads or JSON Bodies Fail
Section titled “Large Uploads or JSON Bodies Fail”Multipart uploads stream to temporary files and follow PHP’s
upload_max_filesize/post_max_size (pass them with pam -d). Other bodies
are limited by maxBodyBytes (2 MiB by default) in pam.php.
Large Downloads Are Cut Off
Section titled “Large Downloads Are Cut Off”Raise maxResponseBytes (and, if needed, maxResponseChunkBytes) in pam.php.
PHP Settings From php.ini Are Ignored
Section titled “PHP Settings From php.ini Are Ignored”PAM embeds PHP and does not read FPM’s php.ini. Pass settings before the
command:
pam -d memory_limit=512M start pam.php --workers 4pam -c /etc/pam/php.ini start pam.php --workers 4/__pam/metrics Always Shows Zero Requests
Section titled “/__pam/metrics Always Shows Zero Requests”Resolve the metrics registry while the worker boots (pam-laravel 0.1.49):
public function boot(): void{ $this->app->make(\Pam\Laravel\Services\ObservabilityRegistry::class);}See Observability.
pam:compatibility Says “Could not download the PAM compatibility registry”
Section titled “pam:compatibility Says “Could not download the PAM compatibility registry””The default registry URL is not currently published. Set
PAM_COMPATIBILITY_REGISTRY to a registry you host, or certify packages
yourself (Package Certification).
pam check-production or pam nightwatch Says “cannot open”
Section titled “pam check-production or pam nightwatch Says “cannot open””These are Artisan commands, not PAM CLI commands. Run
pam artisan pam:check-production, pam artisan pam:nightwatch, and so on.
The Container Is Unreachable
Section titled “The Container Is Unreachable”Inside a container, set PAM_HOST=0.0.0.0; the generated pam.php listens on
127.0.0.1 by default. The variable is PAM_PORT, not PORT.
pam apply Says the Environment File Must Be Mode 0600
Section titled “pam apply Says the Environment File Must Be Mode 0600”pam.toml’s env_file must belong to you and be private:
chmod 600 .envpam:process up Never Returns When Piped
Section titled “pam:process up Never Returns When Piped”The detached processes inherit your pipe. Redirect to a file instead:
pam artisan pam:process up > /tmp/pam-up.log.
Do I need PHP-FPM, Nginx, or a system PHP?
Section titled “Do I need PHP-FPM, Nginx, or a system PHP?”No. PAM serves HTTP itself and embeds PHP. Many teams still keep Nginx or a CDN in front for TLS certificates and static files.
Do I need Laravel Octane?
Section titled “Do I need Laravel Octane?”No. pam start pam.php is a complete persistent runtime. Use the Octane bridge
only if you rely on Octane’s APIs (Octane on PAM).
Is my code “Octane-safe” enough for PAM?
Section titled “Is my code “Octane-safe” enough for PAM?”Yes, the same rules apply. Code that runs correctly under Octane runs correctly under PAM.
Why one request per worker? Is that slow?
Section titled “Why one request per worker? Is that slow?”It is how PHP-FPM works too. The gain comes from not rebooting Laravel for each request. Concurrency comes from the number of workers.
Does $request in a service provider work?
Section titled “Does $request in a service provider work?”During boot there is only a placeholder request (GET http://127.0.0.1/).
Read request data inside middleware, controllers, or scoped() bindings.
Can I run queue workers inside pam start?
Section titled “Can I run queue workers inside pam start?”No. Run pam artisan queue:work as its own process
(Artisan, Queues & Scheduler).
Which Laravel versions are supported?
Section titled “Which Laravel versions are supported?”Laravel 12 and 13 (Compatibility Matrix).
How do I deploy without downtime?
Section titled “How do I deploy without downtime?”Build the release, switch the current symlink, and send SIGHUP to the
master (Deploying Laravel).
Where do I report a problem?
Section titled “Where do I report a problem?”Open an issue on push-in/pam with the
output of pam --version, pam doctor, and a minimal reproduction. Remove
credentials, cookies, and private data first.