Deploy a PHP change
This task is for administrators and developers putting an approved code or settings change live. One command runs every step in the right order and stops at the first failure (Deploying, section 7).
Contents
Before you start
- The change is approved and tested on staging (Staging and approval).
- The new code is on the server (your deployment of the approved commit).
- Shell access in the installation directory.
Steps
Dry run, for the change record (prints the fourteen steps, each marked
DRY, changes nothing):./console exp:velocity deploy --dry-run --allow-root-userRun it:
./console exp:velocity deploy --allow-root-userEach step prints PASS, FAIL or SKIP with its time; the run stops at the first failure with exit status 1.
The steps include the extension autoloads, the INI caches, the template caches, the PHP-FPM step (it waits for OPcache
to revalidate instead of reloading, unless asked, because a reload stalls every pool of that PHP version), the
Velocity restart, the content cache, Velocity's response cache last, and warm-up requests for
[DeploySettings] WarmUpURL[].
Options
| Option | When |
|---|---|
--kernel | a kernel class was added or renamed |
--fpm-reload | php.ini or the pool changed, or files were renamed |
--no-fpm | Velocity only |
--no-velocity | Apache with PHP-FPM only |
--packer | an ezjscore server function or packed scripts and styles changed |
Which PHP-FPM is reloaded comes from [DeploySettings] PhpFpmService (auto looks for the pool named after the
installation's host name): ./console exp:velocity config get DeploySettings PhpFpmService --allow-root-user.
Check it worked
- Every step PASS; keep the output with the change record.
- The changed behavior is visible;
./console exp:logs --tail=var/log/error.log --lines=20shows nothing new. - If something broke: Broken deploy rollback.
Related pages
- Warm the caches after a deploy
- Clear caches after a settings change
- Deploying changes (hosting)
- Velocity engines: deploying a PHP change
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.