# How to use in 5.0 the php 8.1 version?

**URL:** <https://forum.mautic.org/t/how-to-use-in-5-0-the-php-8-1-version/29776>\
**Category:** Mautic 5 Install/Upgrade Support\
**Created:** [October 29, 2023, 9:31am UTC](https://forum.mautic.org/t/how-to-use-in-5-0-the-php-8-1-version/29776 "2023-10-29T09:31:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![stefan-franz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/stefan-franz/32/12758_2.png) [@stefan-franz](https://forum.mautic.org/u/stefan-franz)\
**Post date:** [October 29, 2023, 9:31am UTC](https://forum.mautic.org/t/how-to-use-in-5-0-the-php-8-1-version/29776/1 "2023-10-29T09:31:36Z")

</div>

Hello, to prepare myself for 5.0 i’d like to ask something about using it with php 8.1 on Ubuntu 22.04 server.

At the moment i have only installed php 8.0.30 on my server an there is running Mautic 4.4.10 and Moodle 4.0.3.  
I want to use Mautic 5.0 with php 8.1 (and moodle still with 8.0.30)

1. How is the correct php install command for 8.1 include all required modules?
2. How can i use Mautic with php8.1 (instead of the 8.0)

- Do i have adjust the Cronjobs (and how)?
- Where do i have adjust the setting?
- Special things to do?

---

<div class="post-metadata">

**Author:** ![johnwick](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/johnwick/32/3279_2.png) [@johnwick](https://forum.mautic.org/u/johnwick)\
**Post date:** [November 2, 2023, 8:42pm UTC](https://forum.mautic.org/t/how-to-use-in-5-0-the-php-8-1-version/29776/2 "2023-11-02T20:42:48Z")

</div>

Stefan,  
You can run multiple copies of PHP on a server. I would make sure have each technology running on it’s own subdomain, which you can then set the version of PHP for the subdomain. Or it can be domain and subdomain. In your cronjob, specify which PHP version you’re using to to execute the command.

---

<div class="post-metadata">

**Author:** ![stefan-franz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/stefan-franz/32/12758_2.png) [@stefan-franz](https://forum.mautic.org/u/stefan-franz)\
**Post date:** [November 3, 2023, 5:11am UTC](https://forum.mautic.org/t/how-to-use-in-5-0-the-php-8-1-version/29776/3 "2023-11-03T05:11:18Z")

</div>

Fine.  
These things i’m interessted:

1. What is the command on my ubuntu server to install php 8.1 and all required submoduls of php 8.1?

2. How/where do i set my subdomain (e.g. [mautic.mydomain.de](http://mautic.mydomain.de)) to use the php 8.1

3. My cron job has this synthax. How do i set this to use php 8.1?

```auto
* * * * * php /var/www/html/mautic/bin/console mautic:campaigns:trigger

```

Thanks in advance for detailed answer.

---

<div class="post-metadata">

**Author:** ![stefan-franz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/stefan-franz/32/12758_2.png) [@stefan-franz](https://forum.mautic.org/u/stefan-franz)\
**Post date:** [November 15, 2023, 5:29pm UTC](https://forum.mautic.org/t/how-to-use-in-5-0-the-php-8-1-version/29776/4 "2023-11-15T17:29:03Z")

</div>

I asked here i got a working tutorial for 2 different php versions.

> <https://askubuntu.com/questions/386752/fixing-corrupt-backup-gpt-table/1492792#1492792>

But i wanted to check the used php version with a info.php file in the root directory of Mautic, but i get an error: [https://ma.stefan-franz.de/info.php](https://ma.stefan-franz.de/info.php)  
File content: \<?php phpinfo(); ?\>

What is the reason for this or what do i have to adjust to get access?

---

<div class="post-metadata">

**Author:** ![peter\_k](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/peter_k/32/511_2.png) [@peter\_k](https://forum.mautic.org/u/peter_k)\
**Post date:** [November 28, 2023, 11:40am UTC](https://forum.mautic.org/t/how-to-use-in-5-0-the-php-8-1-version/29776/5 "2023-11-28T11:40:19Z")

</div>

> [@stefan-franz](#):
>
> What is the reason for this or what do i have to adjust to get access?

This is a very basic apache permission problem and probably\[1\] not mautic related. Please google it or use your AI/LLM/GPT of choice to answer and solve this.

In a nutshell: You need to enable access via .htaccess or your vhost or check if you blocked access in some other place.

* * *

1. at best mautic related, as mautics htaccess might have blocked access.

---

<div class="post-metadata">

**Author:** ![mehr](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mehr/32/679_2.png) [@mehr](https://forum.mautic.org/u/mehr)\
**Post date:** [February 17, 2024, 3:51am UTC](https://forum.mautic.org/t/how-to-use-in-5-0-the-php-8-1-version/29776/6 "2024-02-17T03:51:59Z")

</div>

look at your server(i.e. in Ubuntu is /usr/bin/php8.1) and give path to php command in cronjob.  
like:

```auto
* * * * * /usr/bin/php8.1 /var/www/html/mautic/bin/console mautic:campaigns:trigger

```

---

<div class="post-metadata">

**Author:** ![nichy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/nichy/32/12740_2.png) [@nichy](https://forum.mautic.org/u/nichy)\
**Post date:** [March 7, 2024, 1:11pm UTC](https://forum.mautic.org/t/how-to-use-in-5-0-the-php-8-1-version/29776/7 "2024-03-07T13:11:20Z")

</div>

Hello good morning

Not to disturb other forums, I have a similar problem. I have my server with MAUTIC in version 4.4.10 and it suggests upgrading to 5.0.3. I pass a screenshot of my MAUTIC versions.

On the other hand, on my server PLESK tells me that PHP is obsolete in version 8.0.30 and suggests that I move to 8.2.16 on the hosting where I have created the domain for MAUTIC, which is running version 8.0.30 of PHP.

Is it feasible to proceed with it or is it dangerous. Is there someone who has gone through this ordeal. Any recommendation?

Thank you,  
Luis

 ![1-mautic](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/6/62f6d4a9bf22084be2e92db1c36b7c28515264ba.png)
