Skip to content

Troubleshooting & FAQ

Start every investigation with the same three commands from the project root:

Terminal window
pam --version
pam doctor
pam artisan about

Then find your symptom below.

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.

pam start runs OPcache with validate_timestamps=0. Reload the cluster:

Terminal window
kill -HUP <master-pid> # or: systemctl reload example-app

In development, use pam dev pam.php, which restarts on every change. If you cached config or routes, rebuild them first (pam artisan optimize).

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.

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.

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.

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.

Raise maxResponseBytes (and, if needed, maxResponseChunkBytes) in pam.php.

PAM embeds PHP and does not read FPM’s php.ini. Pass settings before the command:

Terminal window
pam -d memory_limit=512M start pam.php --workers 4
pam -c /etc/pam/php.ini start pam.php --workers 4

Resolve the metrics registry while the worker boots (pam-laravel 0.1.49):

app/Providers/AppServiceProvider.php
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.

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:

Terminal window
chmod 600 .env

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.

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.

It is how PHP-FPM works too. The gain comes from not rebooting Laravel for each request. Concurrency comes from the number of workers.

During boot there is only a placeholder request (GET http://127.0.0.1/). Read request data inside middleware, controllers, or scoped() bindings.

No. Run pam artisan queue:work as its own process (Artisan, Queues & Scheduler).

Laravel 12 and 13 (Compatibility Matrix).

Build the release, switch the current symlink, and send SIGHUP to the master (Deploying Laravel).

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.