Upgrading PHP for Mautic

A practical guide to matching PHP versions to Mautic releases, checking required extensions and sequencing PHP and Mautic upgrades so the platform stays on a supported line.

On this page

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.

ChangeImpactAction needed
Mautic 4.4.0 PHP rangeRuns 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 rangeBoth 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 rangeRequires 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 extensionsThe 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.0MySQL 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.0npm 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 requirements

Full 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 requirements

How 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.

  1. 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.

  2. 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.

  3. 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.

  4. 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 -m listing show all required extensions on the new version, and the old package remains available as a rollback point.

  5. 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.

  6. 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.

  7. 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.

  8. 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.

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.

DriverEffect on effortWhat to check
Number of in-house or third-party plugins and themesEach 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 behaviorCode 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 runtimeLarge 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 poolsEvery 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 restartMautic 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 existsA 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.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.