Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

Deploying a change

How a PHP, settings, template or stylesheet change reaches every runtime that serves an Exponential site - the steps of exp:velocity deploy and why their order matters, PHP-FPM reloads and OPcache, Velocity restarts…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/software-engineers/deploying-a-change.md

On this page

Deploying a change

This page is for engineers who ship changes to a running site. Exponential keeps code in more than one runtime (PHP-FPM with OPcache, Velocity's persistent workers) and rendered output in several caches; a deploy that does the right steps in the wrong order looks as if it had not worked. The standard is Compatibility, releases and deployment; the command is documented in Deploying a PHP change.

Contents

  1. One command
  2. The steps and their order
  3. Which change needs what
  4. Upgrading an installation
  5. Rules for code that ships
  6. After the deploy

One command

php bin/php/console exp:velocity deploy --dry-run --allow-root-user  # what it would do, and nothing else
php bin/php/console exp:velocity deploy --allow-root-user            # the usual case
php bin/php/console exp:velocity deploy --kernel --allow-root-user   # a kernel class was added or renamed

It prints PASS, FAIL or SKIP with the time of each step, stops at the first failure and exits with status 1, listing the steps not run. --packer also clears the packed scripts and styles.

The steps and their order

#StepWhy here
1Extension class maps (ezpgenerateautoloads.php -e)new classes must be findable
2Kernel class maps, only with --kernelthe same for the kernel
3INI caches (--clear-tag=ini)settings are read again
4Template, template-override, translation and design_base cachesnew templates and design directories are found
5The engine archive, when Velocity runs from onerebuilt only when kernel/, lib/ or autoload/ changed, every file parsed first
6PHP-FPM: wait for OPcache to revalidate, or reload itthe new code runs under FPM
7Restart Velocity, when it is runningworkers inherit the classes of the warm-up
8Content, HTTP cache and template-block cachesrendered output is cleared only now
9Velocity's response cachethe same, in the server
10Warm-up URLs ([DeploySettings] WarmUpURL[])the first visitor does not rebuild every cache

The order is the point. Cleared before step 6 and 7, every page requested in between is rendered by the old code and cached again. A file that does not parse fails step 5, before PHP-FPM or Velocity is touched.

PHP-FPM is reloaded only when it has to be ([DeploySettings] PhpFpmReload=auto): a reload makes every pool of that PHP version wait for its longest running request. When OPcache revalidates files, the deploy waits revalidate_freq plus one second instead. On a server with several PHP versions, name the service that really serves the site in [DeploySettings] PhpFpmService.

Which change needs what

ChangeNeeds
A PHP class, operator or INI filethe whole deploy
A new or renamed kernel classthe deploy with --kernel
An existing templatethe template caches and Velocity's response cache; no restart
A stylesheet or script of a designthe deploy with --packer, or the packer and template-block caches
Contentnothing; the kernel invalidates
A newly activated extensionthe deploy: its classes, settings and design directories (design_base)

Upgrading an installation

  1. Back up files and database.
  2. Put the new code in place, regenerate the class maps, clear all caches, reload PHP-FPM, restart Velocity.
  3. Apply the database update once, whole, in order (update/database/<driver>/6.0/), then the scripts the guide names.
  4. Read the upgrade notes of every period passed in doc/eng-us/bc/6.0/ and the changelogs.
  5. Check extensions: ./console exp:checkclasses reports classes PHP refuses to load.
  6. Run the upgrade check: Setup > System upgrade, or php bin/php/checkmanifest.php --all --extensions.

Guides: Upgrading, Update with Git.

Rules for code that ships

  • A new class referenced from a shipped INI file should be guarded with class_exists() in the kernel: a Velocity worker started before the deploy does not know it.
  • Templates that use a new class or operator must not reach the servers before the class does; deploy the kernel side first.
  • A deployment must reach every PHP runtime that serves the site; clearing caches alone leaves PHP-FPM and Velocity on the old classes.
  • With several web nodes, deploy each node; exp:velocity deploy covers one machine.
  • In production, consider ManagedByDeployment=enabled, so that the administration cannot write settings or templates that the next deploy would drop (Configuration managed by the deployment).

After the deploy

  • Request the front page and the administration login; check a page whose content you know.
  • Watch error.log in the log viewer for a few minutes.
  • After a Velocity restart, check that a new parent process runs and the port answers (Velocity persistent workers).

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.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x