Why upgrading PHP for Mautic comes before the Mautic upgrade
If your self-hosted Mautic instance runs on an older PHP version, the PHP runtime has to match the Mautic release you are moving to, and the two upgrades are sequenced, not done at random. Mautic publishes a PHP support matrix for each release line, so the target release sets the PHP versions you can run. Moving Mautic first on an unsupported PHP version leaves you with a broken application, and upgrading PHP first on an instance still running an old release can leave the current code unsupported on the new runtime. Plan both moves together from the start.
Mautic follows a published cadence: monthly patch releases, minor releases every three months and major releases every two years. The support dates are what drive your timing. Mautic 4.4 has paid Extended Long Term Support through 31 December 2026, Mautic 5.2 has security support until 30 June 2026, and Mautic 6.0 has security support until 30 September 2026. Mautic 7.2 supports PHP 8.2 to 8.5 with active and security support until 30 September 2026, and Mautic 7.3 is planned as the long-term support release with security support through 31 December 2027. Check these dates against the Mautic releases page for your target, because a release that is still patched today may lose support within months.
The practical path is to identify your current Mautic and PHP versions, pick a target release line that still receives support, and confirm its PHP range on the Mautic requirements page. Then decide the order of work: for many instances that means bringing PHP to a version the current release accepts, verifying the application, and only then moving Mautic. Confirm the exact PHP version and extension set with the vendor documentation for your target release before you schedule any change, since the matrix is the authority for each line. Your own environment, plugins and hosting platform will decide the final sequence.
What changes in the PHP support matrix from Mautic 4 to 7
This table compares the PHP versions, required extensions and database floors for Mautic 4.4.0, 5.2, 6.0 and 7.0 at the points where an upgrade changes what your server must run. Read each row against the release you plan to install. The main takeaway is that Mautic 7.0 requires PHP 8.2 or higher, so the PHP upgrade usually comes before the Mautic upgrade.
| Change | Impact | Action needed |
|---|---|---|
| Mautic 4.4.0 PHP range | Runs on PHP 7.4 and 8.0, the oldest PHP lines in this comparison. | Plan a move to PHP 8.0 or later before upgrading past 4.4.0. Confirm the 4.4.0 release notes. |
| Mautic 5.2 and 6.0 PHP range | Both releases run on PHP 8.1, 8.2 and 8.3. | Confirm your PHP version falls in 8.1 to 8.3 before choosing either release. |
| Mautic 7.0 PHP range | Requires PHP 8.2, 8.3, 8.4 or 8.5. PHP 8.1 is outside the matrix. | Move PHP to a 8.2 to 8.5 release before upgrading to Mautic 7.0. |
| Required PHP extensions | The xml, mysql, imap, zip, intl, curl, gd, mbstring and bcmath extensions are required. | Run php -m on every web and worker node, since command-line and FPM builds can differ. |
| Database floor for Mautic 7.0 | MySQL 5.7 or higher with InnoDB, or MariaDB 10.2 or higher. | Confirm database versions separately, because a PHP upgrade does not change them. |
| npm requirement from Mautic 5.0 | npm is required from Mautic 5.0 onward, so installs moving from 4.x need it added. | Install npm on the host or build machine and confirm the steps in the install documentation. |
What to inventory and back up before changing PHP
A PHP change touches the runtime, the extensions, every plugin and the database that Mautic writes to, so the inventory has to come first. The cards below cover what you need to record, what you need to copy and where you need to test before the new PHP version goes near production.
Current PHP and extension versions
Record the PHP version and every loaded extension on the production web server and on any cron or worker host, since these can differ. Mautic's requirements list the xml, mysql, imap, zip, intl, curl, gd, mbstring and bcmath extensions, so check each one is present for the target PHP version. Confirm the CLI PHP binary matches the one the web server uses, because cron jobs and the mautic:update commands run through the CLI.
Mautic requirementsFull database and file backup
Take a full database dump and a copy of the Mautic application directory, including the local configuration file, before any change. Restore a backup on a separate machine before you rely on it. A PHP upgrade that fails halfway can leave the code, the vendor directory and the database out of step, so you need a copy you have proven you can restore.
Plugin and theme compatibility check
List every installed plugin and theme, its source and its version, then check each one against the target PHP version and the Mautic release you plan to run. Custom in-house plugins often pin older PHP syntax or libraries and need the most attention. Ask the plugin vendor or your developers for written compatibility notes, and remove anything unused before you start.
Staging copy for testing
Build a staging environment that matches production in PHP version, extensions, web server, database version and configuration, then restore a recent backup into it. Run the planned upgrade there first and exercise the paths that matter to marketing teams: logins, form submissions, email sends, segment and campaign updates, and cron-driven jobs. Staging results are only useful if the environment is close to production.
Web server and hosting confirmation
Confirm whether the server runs Apache, Nginx or IIS, and which PHP handler it uses (for example, PHP-FPM or an Apache module), because the handler is often where the PHP version is switched. Mautic should not be installed on shared hosting, and the project recommends a VPS or dedicated server. If you are on shared hosting, plan the move to a VPS or dedicated server before the PHP work starts.
Mautic requirementsHow to sequence PHP and Mautic upgrades
The first decision is whether to raise PHP on your current Mautic release or to move Mautic and PHP together to a target release. Raise PHP first only when your current Mautic release supports the new PHP version. The support matrix is the test. Mautic 4.4.0 runs on PHP 7.4 and 8.0, Mautic 5.2 and 6.0 run on PHP 8.1 to 8.3, and Mautic 7.0 runs on PHP 8.2 to 8.5. If your source release is on PHP 8.0 and you need PHP 8.2 for the target, you cannot finish the PHP change in place first, so the two upgrades have to be planned as one change with a tested copy. If your source release already lists the newer PHP version, a PHP-only change on the current release gives you a controlled checkpoint before the Mautic change. Confirm the exact PHP versions against the Mautic requirements page for both releases before you choose.
Whichever order you choose, the PHP change touches the background services as well as the web pages. Mautic relies on cron jobs for segment updates, campaign updates and campaign triggers, plus a broadcasts command for segment emails and a messenger consumer when emails are queued. Each of these runs the PHP binary from your server configuration, so after the PHP switch, confirm that the cron entries, the consumer service and the web server all point to the new PHP version. Check that the jobs run without errors, that campaign triggers fire for a test contact, and that queued email is still moving. Stagger the cron entries as the Mautic documentation describes, and avoid running two long jobs against the same database at once during the test window.
Record the results before you move on. Keep the old PHP package available until the post-change checks pass, and note the exact PHP and extension versions in your change record, including the required xml, mysql, imap, zip, intl, curl, gd, mbstring and bcmath extensions. Ask your Mautic support or implementation partner to confirm the extension list for your target release before the change window, because a missing extension can break the upgrade after the PHP switch has already been made. Plan a rollback path that restores the previous PHP version, the previous Mautic files and the database backup together, so you are not reverting one layer while the other stays on the new version.
Upgrade sequence with checks and rollback points
This sequence moves PHP and Mautic together in a controlled order, so each change can be verified and reversed on its own. It ends with a production upgrade that follows a rehearsed path and a documented rollback point at every stage.
Confirm the target Mautic release and PHP range
Identify the Mautic release you are moving to and check its PHP range on the Mautic requirements page before touching any server. For example, the matrix lists 7.0 on PHP 8.2 to 8.5, while 5.2 and 6.0 run on 8.1 to 8.3, so a PHP version chosen for one release can block another. Record the current PHP version, Mautic version, web server, and database version, then confirm the target PHP version also covers your plugins and themes. Done when you have a written version pair (Mautic target, PHP target) signed off by the owner of the instance.
Back up the database and application files
Take a full database dump and a copy of the Mautic application directory, including configuration and any custom plugins, themes, and uploaded assets, and store both outside the server being changed. Record the PHP package versions and the Mautic commit or package version so the exact pre-upgrade state can be restored. Test that the database backup restores on a separate host, since a backup that has never been restored is not yet a rollback point. Done when the restore test completes and the backup checksums are logged.
Build a staging copy of the current instance
Restore the production database backup and the file copy onto a staging server that matches production's web server, database and PHP setup as closely as possible. Point staging at a non-production mail transport and disable or redirect outbound email, so test runs cannot reach real contacts. Confirm the staging Mautic login and a sample of contacts and segments load before changing anything. Done when staging matches production in version, configuration and data, and this is recorded as the baseline for comparison.
Upgrade PHP and install required extensions on staging
Install the target PHP version on staging, then add the extensions listed in the Mautic requirements: xml, mysql, imap, zip, intl, curl, gd, mbstring and bcmath. Switch the web server and command-line PHP to the new version, and confirm both report the same version and load every extension. Keep the previous PHP package installed so it can be reactivated. Done when a PHP information check and a
php -mlisting show all required extensions on the new version, and the old package remains available as a rollback point.Run the Mautic upgrade on staging
Run the upgrade on staging using the path that matches your install method: the mautic:update commands for a package install, or composer update for a Composer install, executed as the web server user so file ownership stays correct. Clear the cache, run database migrations, and review the command output for errors or deprecation warnings from plugins. Fix any plugin incompatibility on staging before production. Done when the command completes without errors and the Mautic admin pages load on the new PHP and Mautic versions.
Verify cron jobs, the messenger consumer and email sending
Check that the segment, campaign update and campaign trigger cron jobs run on staggered schedules, that the broadcasts command runs for segment emails, and that the messenger consumer is running if emails are queued. Send a test campaign email to an internal test contact and confirm it arrives, that tracking and unsubscribe links resolve, and that the queue drains. Review the logs for PHP fatal errors after each job. Done when each scheduled job has a recorded successful run and a test email has been delivered on the new stack.
Repeat the sequence on production in a planned window
Schedule a production window with the stakeholders who depend on campaigns and email, and repeat the backup, PHP change, extension install, Mautic upgrade and checks in the same order used on staging. Pause the queue and cron jobs before the database migration, and bring them back only after the post-upgrade checks pass. Keep the production backup and the old PHP package ready until the checks are signed off. Done when production runs the target versions, the checks pass, and the window and results are documented.
Define rollback points and confirm restoration
After each step, record what can be reversed and how: the reinstalled previous PHP package for PHP-only changes, and the restored database backup plus the saved application files for Mautic changes, since a database migration cannot be reversed by reinstalling PHP. Agree the rollback decision criteria before the window, and keep the backups until the post-upgrade checks have run through a full campaign cycle. Done when the rollback procedure has been written for each step and the restore has been rehearsed on staging.
Decision path for matching PHP to the Mautic release
The path starts with the current Mautic version and the PHP version running on the server. The first check is whether that PHP version sits inside the supported range for the target Mautic release. If it does, teams can move Mautic first; if it does not, PHP must be upgraded first or both moved together under a single plan. Before production, confirm the required extensions, cron jobs and queue workers, then test the full sequence on a staging copy.
Decision path for matching PHP and Mautic versions before production.
How the PHP upgrade differs by install method and environment
Installs from the production package, using the web or command-line installer, keep Mautic's files on your server as a release you unpacked yourself. The PHP runtime is not part of that package. Your team (or your partner) installs and changes PHP through the operating system or the hosting stack, then runs Mautic's own update commands against the new code.
- PHP runtime: the PHP binary and its version come from your operating system packages or your web stack, so a PHP change happens outside Mautic.
- Extensions: the xml, mysql, imap, zip, intl, curl, gd, mbstring and bcmath extensions must be installed for the PHP version you move to.
- Web server user: run the update commands as the same user that owns the Mautic files, or file permissions break after the upgrade.
- Order: change PHP only after you confirm the target Mautic release supports that PHP version, then update Mautic.
- Rollback: keep the previous PHP package and a tested backup so you can return to the prior runtime if the update fails.
Check the PHP version your target Mautic release lists on the Mautic requirements page before you change anything on the server.
Composer installs use the recommended project template, which has been the supported approach since Mautic 4.0. Dependencies, including the Symfony components Mautic is built on, are declared in the project and resolved by Composer. The PHP version constraint in the project determines which dependency versions Composer will accept, so a PHP upgrade and a dependency change are tied together.
- Constraint check: Composer will refuse to install packages that do not match the PHP version on the server, which is useful as an early signal.
- Lock file: review changes to the lock file during the upgrade so you can see which dependency versions moved with the new PHP requirement.
- Plugins: custom and third-party plugins may declare their own PHP requirements, so test them against the new runtime before the switch.
- Staging first: run the Composer update on a copy of the production project and the same PHP version before touching production.
- Same user: run Composer as the web server user where practical, so file ownership stays correct.
Confirm that your target release and each installed plugin declare compatibility with the PHP version you plan to run.
On a self-managed VPS or dedicated server, your organization controls the whole PHP stack: the operating system, the PHP packages, the web server, and the database. The project's requirements page says Mautic should not run on shared hosting and recommends a VPS or dedicated server, so this is the normal model for a self-hosted deployment. Your team owns every PHP change, including security patches and end-of-life planning.
- Ownership: a named team should own PHP versions, extension packages and the schedule for changes.
- Multiple PHP versions: some servers run more than one PHP version side by side, which helps when you need to switch the web server pool and the command-line runtime together.
- Command-line runtime: cron jobs and the messenger consumer run under the command-line PHP binary, so update that binary as well as the web runtime.
- Change window: plan the PHP switch and the Mautic update in one maintenance window with a tested backup.
- Monitoring: watch PHP error logs and the Mautic cron jobs after the switch, since background work can fail without a visible page error.
Confirm which PHP binary your cron jobs and workers call, and update every one of them.
Managed Mautic hosting is a separate option that mautic.org promotes alongside the free self-hosted download. The provider's terms, not your team's change process, decide when PHP and Mautic versions change and who makes the change. Your responsibilities shift to the contract, the change notices and the testing you do on your own content and integrations.
- Provider scope: ask in writing which PHP versions the provider supports, who applies PHP changes, and how much notice you receive.
- Extensions: confirm the provider installs the required extensions for each PHP version it offers.
- Custom code: your plugins, themes and custom integrations still need testing on any runtime the provider switches to.
- Access: confirm whether you can access cron, queue workers and logs needed to verify a change.
- Exit path: check how you would move to a self-managed server if the provider's PHP schedule does not fit your plans.
Ask the provider to put the PHP and Mautic version commitments in the service agreement, and check that they match the Mautic release lines you plan to use.
Shared hosting is the environment the Mautic project says to avoid. Many shared plans limit which PHP versions you can select per account, restrict the extensions you can install, and limit access to the command line and background processes. Those limits can block a PHP upgrade that a supported Mautic release requires.
- Version limits: the host may not offer a PHP version that matches a current Mautic release.
- Extension limits: the host may not provide every required extension, so the install fails or features break.
- Background jobs: shared plans often restrict the cron and long-running processes Mautic needs for segments, campaigns and queued email.
- Migration cost: moving off shared hosting is usually a planned migration, not a PHP setting change.
- Decision point: if the host cannot meet the target PHP and extension list, plan a move to a VPS or dedicated server before the upgrade.
Before planning any PHP change on shared hosting, confirm with the host that it supports the target PHP version and every required extension.
What makes a PHP upgrade for Mautic take longer
This table lists the factors that most often stretch a PHP upgrade on a self-hosted Mautic instance, how each one changes the effort, and what to check before you schedule the work. Use it to size the upgrade with your team or to scope a partner quote, since the same PHP move can be quick on a small, well-staged install and slow on a heavily customized one.
| Driver | Effect on effort | What to check |
|---|---|---|
| Number of in-house or third-party plugins and themes | Each plugin or theme must be confirmed against the target PHP version and Mautic release, and incompatible ones need updates or replacement before cutover. | Inventory every plugin and theme, its source, its maintainer's stated PHP support, and whether a version exists for your target Mautic line. |
| Custom code tied to older PHP behavior | Code that relies on deprecated functions, removed behavior or loose type handling can fail only after the upgrade, which makes testing and fixes take longer. | Run static analysis and the test suite on the target PHP version, and review custom code for deprecation warnings in logs from a staging run. |
| Database size and migration runtime | Large contact and event tables lengthen any database step that runs during the Mautic upgrade, and a long window leaves less room for rollback. | Measure table sizes, confirm how long a full backup and restore take in your environment, and plan the maintenance window around them. |
| Number of web servers or PHP-FPM pools | Every server or pool must be switched to the new PHP version and reloaded, and mismatched pools can serve requests on two versions at once. | List each web node, its PHP-FPM pool and socket, and the php.ini and extension files it loads, then confirm they all point to the same target version. |
| Number of cron jobs and queue workers to restart | Mautic depends on scheduled jobs and a messenger consumer for segments, campaigns and queued email, so each process running the old PHP binary must be found and restarted. | Check the crontab and process manager on every host, confirm the CLI PHP binary used by cron matches the web PHP version, and confirm the jobs are staggered as the cron documentation describes. |
| Extension gaps (imap, intl, bcmath and others) | A missing extension can block the upgrade or break email, localization or number handling, and installing it on a new PHP build can take extra packaging work. | Compare the installed extensions for the target PHP version against the required list: xml, mysql, imap, zip, intl, curl, gd, mbstring and bcmath. |
| Whether a staging environment exists | A staging copy with a restored database lets the team test plugins, cron and email before production, while without one the upgrade carries most of its risk into the live system. | Confirm a staging host can run the same PHP version, web server and database engine, and that it holds a recent copy of production data handled under your data policy. |
Questions teams ask before upgrading PHP for Mautic
What drives the cost of a PHP upgrade for Mautic?
The cost follows the amount of verification work, not the PHP change itself. The main drivers are how many PHP versions you cross, how many plugins and custom themes run on the instance, whether the install is Composer-based or a package install, and how much of the surrounding stack (web server, database, PHP extensions) must also change. Cost is one-time for the upgrade project and recurs only if you buy ongoing support or retesting. Ask any provider for a written scope that lists each component to be tested, the target Mautic and PHP pairing, and who performs the rollback plan. Compare quotes on those line items, not on a headline number.
How long does a PHP upgrade for Mautic take?
Duration depends on the number of moving parts, not on a fixed rule. Plugin compatibility checks, the size of the test copy you need, how quickly your team can review results, and how many staging cycles you run before production all change the schedule. Mautic's PHP matrix sets which combinations are valid, so the first step is confirming your target pairing. Ask for a scoped estimate that breaks the work into discovery, staging, production cutover and post-upgrade checks, with a named dependency on your change windows. Any date given before the scope is written should be treated as provisional.
What does the internal team need to provide for a PHP upgrade?
A PHP upgrade needs more from your team than from the vendor. Expect to provide:
- Administrative access to the server, web server configuration and the PHP-FPM or module settings
- A recent, tested backup of the database and the Mautic files
- A test copy of the production instance that matches its extensions and configuration
- Named plugin and theme owners who can confirm behavior after the change
- A change window and a decision-maker who approves cutover
Confirm with your provider which of these they will hold and which remain with your staff, and write the responsibilities into the scope.
Can our own team upgrade PHP for Mautic without a partner?
Yes, if your team has Linux server administration skills, access to a staging copy and time to test. The Mautic requirements page lists the supported PHP versions and the required extensions, including xml, mysql, imap, zip, intl, curl, gd, mbstring and bcmath, so the checklist is well defined. Where teams struggle is in plugin compatibility, cron and queue behavior after the change, and rollback. Assess your skills against those three areas. A partner is most useful when you need an independent test plan, a documented rollback, or capacity during a tight window.
Which PHP version should we choose for Mautic 7?
Mautic 7.0 supports PHP 8.2, 8.3, 8.4 and 8.5, according to Mautic's requirements page. Mautic 7.2 supports PHP 8.2 to 8.5. Choose the newest version in that range that your operating system, your plugins and your other applications on the same server all support. Confirm that each plugin and custom theme lists compatibility with your chosen version. Also check which Mautic release you plan to run, because the supported PHP range differs between Mautic lines. Confirm the final pairing against the current requirements page before you start.
What happens if a PHP upgrade fails?
A failed PHP upgrade usually shows up as a blank page, a fatal error, broken plugin behavior, or failing cron and queue jobs. The safe response depends on rollback planning done before the change. Keep the previous PHP package or handler available, record the exact versions and extension list, and keep a tested database and file backup taken immediately before cutover. Restore the previous PHP configuration, confirm the web server and PHP-FPM restart cleanly, and then check cron, the broadcasts command and the messenger consumer. Ask any provider for a written rollback procedure and a timed check of how long it takes to restore service.
How to test and roll back a failed PHP change
Run the PHP change on a staging copy of the Mautic instance before production, and treat the change as failed until every check below passes. Start with login: confirm that a named administrator and a standard user can sign in, since basic authentication and any SAML single sign-on provider both depend on the web server and PHP session handling working. Then import a small test batch of contacts through the import tool, rebuild one segment that uses a non-trivial filter, and confirm the counts match what you expect from the production data. Next, trigger one campaign manually or with a test contact, send a test email through the transport you actually use in production, and check the delivery log and tracking. Finally, run each cron job that Mautic relies on for segment updates, campaign updates, campaign triggers and broadcasts, plus the messenger consumer if your installation queues email, and confirm each one completes without PHP errors in its output. Ask your partner or internal team to write the exact commands and expected results down before the change, so the test is a pass or fail decision rather than a judgment made under pressure.
Plan two rollback points before you touch production. The first is the previous PHP package or runtime, which you keep installed or can reinstall so the web server and command line can switch back to the prior version quickly. Confirm that the PHP-FPM or module configuration for the old version still exists and that the web server can point to it without other changes. The second is a database backup taken immediately before the change, verified by restoring it to a separate database and checking that Mautic starts against it. Database rollback matters because a PHP version change can coincide with a Mautic upgrade that runs schema migrations, and rolling back PHP alone does not undo those changes. Keep the backup of the Mautic files and configuration with it, so the code and data match. Confirm with your hosting or platform team how long a restore takes in your environment, because the project documentation does not give a duration and your own restore timing should set the change window.
How DeployOpen scopes and delivers a Mautic PHP upgrade
DeployOpen plans and carries out PHP version changes for self-hosted Mautic inside your own infrastructure, sequenced against the Mautic release you run or plan to move to. Engagements are fixed-scope, with the PHP target, extensions, test plan and handover agreed in writing before work starts.
How we scope
- Inventory your current Mautic release, PHP version, web server and installed plugins before proposing a target.
- Confirm the PHP target against the Mautic requirements matrix for your planned release line.
- Check required extensions (xml, mysql, imap, zip, intl, curl, gd, mbstring, bcmath) on every node.
- Agree in writing whether the work covers PHP only or PHP and a Mautic release in one sequence.
How we build
- Build and test the PHP upgrade on a copy of your Mautic instance and database before production.
- Verify plugin and theme compatibility with the target PHP version and record every change made.
- Update cron jobs, queue workers and the messenger consumer so they run under the new PHP binary.
- Keep a tested backup and a documented rollback path to the previous PHP version at every step.
How we hand over
- Deliver a written record of the PHP and extension versions, configuration changes and test results.
- Provide a runbook covering the upgrade sequence, rollback steps and the commands the web server user runs.
- Walk your administrators through the post-upgrade checks, including cron and email sending.
- Document open items, such as plugins that need vendor updates, with owners named by you.
How we support
- Ongoing support, upgrades and continuous testing are available as a retainer after handover.
- A retainer can cover the next PHP and Mautic release steps as your release line moves forward.
- Confirm with your team which environments, change windows and approval steps apply before scheduling.

