Skip to content

PHP/Laravel deploy hardcodes php8.3-fpm restart — fails on pods with a different PHP version (e.g. 8.4) #3

Description

@vikasiwp

PHP preset's Laravel deploy hardcodes php8.3-fpm restart — fails on pods created with a different PHP version

The new native Laravel build pipeline (nice addition — it auto-runs the npm build, sets public/ docroot, storage perms, APP_KEY) ends with a service restart that appears to hardcode php8.3-fpm:

=== Restarting services ===
Failed to restart php8.3-fpm.service: Unit php8.3-fpm.service not found.
ERROR: service restart failed: exec in <pod>: command exited with code 5

Our pod was created with pods create --version 8.4 (the app's composer.lock requires PHP ≥ 8.4.1), so only php8.4-fpm exists → every deploy fails at the final restart step, even though composer install, npm build, and Laravel setup all succeed just above it. Result: the app is actually built, but the deploy is marked failed and fpm isn't reloaded.

Repro: create a php pod with --version 8.4 (or 8.2), connect a Laravel repo, deploy → fails at "Restarting services".

Fix: derive the fpm unit from the pod's actual PHP version (php${PHP_VERSION}-fpm) instead of hardcoding 8.3.

Workaround (what I used):

ln -sf /usr/lib/systemd/system/php8.4-fpm.service /etc/systemd/system/php8.3-fpm.service
systemctl daemon-reload

so the hardcoded systemctl restart php8.3-fpm resolves to the 8.4 unit. After that the deploy completes green.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions