PHP Runtime Manager
PAM brings its own PHP. You do not install PHP, compile extensions or keep a system php binary in sync with production: every PAM release embeds one exact PHP build, with its php.ini, its extensions and its version, and every PAM command uses that build. Native and Desktop targets inherit their PHP from PAM too, through a pinned runtime catalog.
This page shows where that runtime lives, how to configure it, and how mobile projects pin a PHP series.
The Server Runtime
Section titled “The Server Runtime”Each PAM release is installed into its own versioned directory, and pam on your PATH points to the active one:
~/.local/share/pam/v2.2.27-linux-x86_64/├── bin/ pam and its launcher├── etc/│ ├── php.ini PAM's base PHP settings│ └── conf.d/ one .ini file per bundled extension├── lib/ libphp and private shared libraries└── share/Several releases can sit side by side; pam self-update installs the next one and switches the link. Because each directory is complete, a project never runs against a half-upgraded runtime.
Ask PAM which PHP it embeds with pam inspect, or validate the whole setup with pam doctor:
pam doctorPAM / SYSTEM DIAGNOSTICS────────────────────────────────────────────────────────────● [ok] PHP Embed version: 8.5.13◆ [info] Embed SAPI: embed◆ [info] Zend Engine: 4.5.13◆ [info] Embed php.ini: ~/.local/share/pam/v2.2.27-linux-x86_64/etc/php.ini◆ [info] Embed scanned INI files: 38◆ [info] Xdebug=false · OPcache=true(Output trimmed.) The PHP build is non-thread-safe ("zts": false in pam inspect), 64-bit, with OPcache enabled.
Default Settings
Section titled “Default Settings”The bundled php.ini is intentionally short and production-oriented:
expose_php=Offdisplay_errors=Offlog_errors=Onvariables_order=GPCSzend.assertions=-1Everything else uses PHP’s defaults (for example memory_limit=128M). In server mode PAM also keeps display_errors off and log_errors on, unless you enable the exposeErrors listen option, so warnings never leak file paths into responses.
Bundled Extensions
Section titled “Bundled Extensions”The release ships 57 extensions, including bcmath, curl, dom, gd, intl, mbstring, mysqli, PDO with pdo_mysql, pdo_pgsql and pdo_sqlite, pgsql, sodium, sockets, xml, zip and Zend OPcache. List the exact set of your release:
pam -r 'echo implode(PHP_EOL, get_loaded_extensions()), PHP_EOL;'Configuring PHP
Section titled “Configuring PHP”pam accepts the familiar PHP CLI flags before the script name:
| Flag | Effect |
|---|---|
-d name=value |
Set an INI directive (repeatable) |
-c path |
Use another php.ini file |
-n |
Ignore every php.ini and the conf.d directory |
-r code |
Run inline code |
pam -d memory_limit=256M -d opcache.jit=tracing index.phppam -r 'echo ini_get("memory_limit"), PHP_EOL;'-n loads only the extensions compiled into the binary (19 instead of 57), which is useful to prove which extensions your code really needs.
Loading Only the Extensions You Need
Section titled “Loading Only the Extensions You Need”By default every bundled extension is loaded. In production you can load an explicit allowlist instead, which shortens boot and reduces the attack surface:
pam start index.php --workers 8 --php-extension pdo --php-extension tokenizerWith at least one --php-extension, PAM stops scanning conf.d and loads only the listed extensions. pam extensions derives that list from your locked Composer requirements; see Composer Integration.
PHP Version Policy
Section titled “PHP Version Policy”PAM embeds PHP 8.5 by default. That is a product rule, not just the newest entry of a test matrix:
- official PAM runtime artifacts embed PHP 8.5;
pam initprojects and the official skeleton requirephp: ^8.5;- release, container, security and compatibility workflows build against PHP 8.5.
PHP 8.4 remains available as an explicit compatibility choice for Native runtimes while it is maintained. Patch releases inside the 8.5 series ship with regular PAM releases; moving the default to a new series would be a deliberate, documented runtime release.
Native and Desktop Runtimes
Section titled “Native and Desktop Runtimes”Mobile and desktop apps cannot download PHP from the system, so PAM resolves their runtime from a signed-off runtime catalog (runtime/catalog.json in the PAM distribution). Each catalog entry pins:
- the official php.net source URL and its SHA-256;
- the Android API level, NDK version and minimum iOS version;
- the extension set compiled into the mobile runtime;
- a PAM runtime revision.
At the time of writing the catalog offers two channels:
| Series | Runtime ID | Extensions |
|---|---|---|
8.5 (default) |
8.5.12-r1 |
ctype, filter, opcache, phar, session, tokenizer, uri |
8.4 |
8.4.27-r1 |
ctype, filter, phar, session, tokenizer |
Runtime IDs
Section titled “Runtime IDs”Runtime IDs follow <php-version>-r<revision>. A PHP security update changes the PHP version and resets the revision to 1. A PAM portability patch, build flag or packaging fix only increments the revision. 8.5.12-r1 means “the first PAM build of the verified official PHP 8.5.12 source”.
Choosing the PHP Series
Section titled “Choosing the PHP Series”A PAM Native project declares its series in pam-native.json:
{ "runtime": { "php": "8.5", "channel": "stable" }}The PAM Native package adds commands to manage it. They default to the current project:
pam mobile runtime:list # catalog channels, the selected one marked with *pam mobile runtime:use 8.5 # write the series to pam-native.json and lock itpam mobile runtime:info # the resolved runtime, NDK and extensionspam mobile runtime:update # re-resolve the series and rewrite the lockThe resolution is written to .pam-native/runtime.lock.json. Release builds read that lock instead of resolving “latest” at build time, so the same commit always builds against the same PHP.
Reproducible Builds
Section titled “Reproducible Builds”- Commit
pam-native.json, and keep.pam-native/runtime.lock.jsonas a CI or release artifact. - PAM release automation rebuilds every supported Android ABI from the verified source and publishes the runtimes with build provenance.
- Native and Desktop packages never bundle a second PHP toolchain of their own; runtime fixes go into the central catalog as a new revision.
Next Steps
Section titled “Next Steps”- Composer Integration: Composer, platform checks and extension profiles
- Installation: installing and updating PAM
- Compatibility: extensions and packages in a persistent process