At the moment I have running PHP 8.0 with Mautic and Moodle on a VPS with Ubuntu Server 22.04.
I want to install Suite CRM what needs php8.1 and another app who needs php8.2.
How to install php8.1 and php8.2. I want to keep my default php8.0 and the applications will initially continue to run under 8.0?
How can I set the PHP version for every site/app?
About cron jobs: At the moment the cron job in Mautic is e.g.
* * * php /var/www/html/mautic/bin/console mautic:campaigns:trigger
How do i set an cron job that it use a special php version? (Mautic and Moodle needs cron jobs)
Here ist my config for mo.stefan-franz.de
:
<VirtualHost *:80>
ServerAdmin info@stefan-franz.de
DocumentRoot /var/www/html/moodle/
ServerName mo.stefan-franz.de
<Directory /var/www/html/moodle/>
Options +FollowSymlinks
AllowOverride All
Require all granted
</Directory>
<FilesMatch .php$>
SetHandler "proxy:unix:/run/php/php8.1-fpm.sock|fcgi://localhost/"
</FilesMatch>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =mo.stefan-franz.de
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
My SSL configuration_
root@mautic01:/etc/apache2/sites-available# ls -alh
total 44K
drwxr-xr-x 2 root root 4.0K Nov 14 12:19 .
drwxr-xr-x 8 root root 4.0K Nov 7 08:31 ..
-rw-r--r-- 1 root root 1.3K Apr 8 2023 000-default.conf
-rw-r--r-- 1 root root 4.5K Apr 8 2023 default-ssl.conf
-rw-r--r-- 1 root root 647 Sep 30 12:40 ma.stefan-franz.de-le-ssl.conf
-rw-r--r-- 1 root root 532 Nov 14 12:19 ma.stefan-franz.de.conf
-rw-r--r-- 1 root root 626 Oct 8 19:56 mo.stefan-franz.de-le-ssl.conf
-rw-r--r-- 1 root root 466 Oct 8 19:56 mo.stefan-franz.de.conf
-rw-r--r-- 1 root root 636 Nov 7 08:31 shop.stefan-franz.de-le-ssl.conf
-rw-r--r-- 1 root root 474 Nov 7 08:31 shop.stefan-franz.de.conf
And here is the SSL config for moodle:
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin info@stefan-franz.de
DocumentRoot /var/www/html/moodle/
ServerName mo.stefan-franz.de
<Directory /var/www/html/moodle/>
Options +FollowSymlinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLCertificateFile /etc/letsencrypt/live/mo.stefan-franz.de/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/mo.stefan-franz.de/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
Header always set Strict-Transport-Security "max-age=31536000"
php.ini
. – sotirov Nov 14 '23 at 16:59