Existing issue
- I have searched the existing issues and found no duplicate.
Problem or use case
Generated PHP builds run with PHP's built-in defaults. Openship offers no setting to change them. References are at 8cddb2675.
- The runtime stage writes no
php.iniand sets no PHP directives (packages/adapters/src/runtime/docker-recipes/php.ts:127-173). - The FrankenPHP images ship no
php.ini(https://frankenphp.dev/docs/config/, "Docker" section). - The built-in defaults are
upload_max_filesize=2M,post_max_size=8Mandmemory_limit=128M(php-srcmain/main.c). - The edge accepts request bodies up to 50 MB by default (
packages/adapters/src/infra/openresty-lua.ts:100).
So an upload between 2 MB and 50 MB passes the edge and then fails inside PHP. PHP does not let application code raise the two upload limits with ini_set(). A global memory_limit for workers and release commands has the same gap. openship.json has no field for PHP settings.
Proposed solution
Two possible shapes:
-
A
phpInimap inopenship.jsonand the build settings, from directive name to value:{ "phpIni": { "upload_max_filesize": "25M", "post_max_size": "30M", "memory_limit": "512M" } }The recipe writes it to
$PHP_INI_DIR/conf.d/zz-openship.iniin the runtime stage. Web, role and release containers then share the same settings. Validation can reject keys that do not match^[a-z0-9_.]+$and values that contain line breaks or quotes. -
An ini file in the image that reads environment variables. PHP expands
${VAR}in ini files. The recipe could ship lines such asupload_max_filesize = ${PHP_UPLOAD_MAX_FILESIZE}and set defaults withENVin the image. Projects then change the values through their environment, without a rebuild and without a new project field. The serversideup/php images use this pattern, with slightly different variable names.
A possible follow-up: derive upload_max_filesize and post_max_size from the project's clientMaxBodySize (#100), or from the 50m edge default when it is unset. Per-domain caps (#1431) would need a rule for which value applies.
If you prefer no new PHP-specific setting, two smaller changes would cover the upload case. The recipe could match PHP's upload limits to the edge limit. Or the docs could describe PHP_INI_SCAN_DIR as the supported route.
Alternatives considered
FRANKENPHP_CONFIGwithphp_inilines. The bundled Caddyfile reads it, but it applies to the web server only, not to CLI workers or release commands. Openship does not document it as a setting.PHP_INI_SCAN_DIRset to a value such as:/app/docker/php, a directory of.inifiles in the repository. The leading colon keeps the image'sconf.d, which loads the PHP extensions. This covers every process, but each application must carry and remember the files.- A runtime install step (#1773) could also write such a file, but a typed setting is easier to validate.
- A custom
runtimeImagethat ships its ownphp.ini. This needs a maintained base image.
I have not tested FRANKENPHP_CONFIG or PHP_INI_SCAN_DIR on Openship.
Additional context
My case is a Laravel 13 application that accepts attachments of up to 25 MB.
Activity
0No activity yet.