Lionel Krieger
Lionel Krieger

Reputation: 11

Why am I getting this error even though I have php 7.4 on ubuntu ? "Mautic does not support PHP version 8.1.2 at this time..."

php version info on ubuntu

Should I adjust settings somewhere else so that Mautic can make use of PHP 7.4?

Message I get when navigating to the Mautic installation in the browser "Mautic does not support PHP version 8.1.2 at this time. To use Mautic, you will need to downgrade to an earlier version."

Upvotes: 1

Views: 2304

Answers (2)

Phill Ash
Phill Ash

Reputation: 371

Just to add in case it helps anyone else, the root cause of my problem (mentioned in the comment above) of being unable to adjust the php versions despite attempting the various config adjustments suggested above was that I was running virtual host configuration on my server. The reason being was that I had subdomains running for suitecrm as well is mautic and each had it's own configuration file (two in fact - one ssl version).

The ssl versions of the virtual host configuration contained an explicit definition of the php version I should be using which was overriding everything else.

Full details of how you do it are here in case anyone else needs to run mautic and suitecrm on the same server and wants to use the different recommended versions of php.

Specifically it's this bit in the virtual hosts configuration file.

    <FilesMatch \.php$>
  # For Apache version 2.4.10 and above, use SetHandler to run PHP as a fastCGI process server
  SetHandler "proxy:unix:/run/php/php7.2-fpm.sock|fcgi://localhost"
</FilesMatch>

Upvotes: 0

Surge
Surge

Reputation: 21

You need to downgrade your current php version. It looks like you are running 8.1.2 which is generally shipped with ubuntu 22.04.

You need to downgrade to 8.0 in order for Mautic 4.x to work. If you are on a lesser version you will need to downgrade to 7.4.

To downgrade to 8.0 run the following commands:

sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php -y
sudo apt update
sudo apt install php-imagick php8.0-fpm php8.0-mysql php8.0-common php8.0-gd php8.0-imap php8.0-imap php8.0-curl php8.0-zip php8.0-xml php8.0-mbstring php8.0-bz2 php8.0-intl php8.0-gmp
systemctl start php8.0-fpm

Then go ahead and create this file sudo nano /etc/php/8.0/fpm/conf.d/60-custom.ini

and put the following content inside:

# Default is 128M. Set it to 512M for better performance.
memory_limit = 512M

# Set default timezone in PHP. You can find your own time zone format at https://www.php.net/manual/en/timezones.php
date.timezone = America/New_York

# Set the max file upload size in PHP
upload_max_filesize = 256M
post_max_size = 256M

# Change session lifetime to avoid the CSRF token error.
session.gc_maxlifetime = 14400

; The OPcache shared memory storage size.
opcache.memory_consumption=256

; The amount of memory for interned strings in Mbytes.
opcache.interned_strings_buffer=32

sudo systemctl reload php8.0-fpm

run this and choose 8.0 for your version: sudo update-alternatives --config php

If you are using nginx make sure that in your mautic.conf file you are calling php8.0-fpm

If you are running apache you need to use a2enmod (I am less familiar so I would suggest googling how to disable 8.1 and enable 8.0)

Upvotes: 2

Related Questions