I am trying to get a second PHP version running under Virtualmin.
I do the following:
- add-apt-repository -y ppa:ondrej/php
- apt-get install -y php7.1 php7.1-cgi php7.1-bcmath php7.1-json php7.1-imap
And then I go to Virtualmin and choose Server Configuration->PHP versions and change the setting
However, when I then check the old PHP version is still running.
So I tried it in the console:
- a2dismod php7.2
- a2enmod php7.1
The first command workd. However, second causes the error: ERROR: Module php7.1 does not exist!
When studied the a2enmod command it appeared that creates virtual links in the conf.d directory. It is there that things may go wrong as under /etc/php/7.1 I don’t have an Apache2 directory and as a consequence neither a conf.d directory below that.
So my questions are: what did I do wrong? How should I fix this? Can I just make a copy of the directories below my /etc/php/7.2?
Copying the apache2 directory doesn’t work. I still get after a2enmod: ERROR: Module php7.1 does not exist!
I tried another command: update-alternatives --set php /usr/bin/php7.1.
When you next do the command “service apache2 restart” you get an error: “Job for apache2.service failed because the control process exited with error code.
See “systemctl status apache2.service” and “journalctl -xe” for details.”
The status command delivers:
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: failed (Result: exit-code) since Tue 2019-02-26 15:09:19 UTC; 33s ago
Process: 22613 ExecStop=/usr/sbin/apachectl stop (code=exited, status=1/FAILURE)
Process: 4270 ExecReload=/usr/sbin/apachectl graceful (code=exited, status=1/FAILURE)
Process: 22618 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
Main PID: 10713 (code=exited, status=0/SUCCESS)
Feb 26 15:09:19 myserv.mydom.com systemd[1]: apache2.service: Failed with result ‘exit-code’.
Feb 26 15:09:19 myserv.mydom.com systemd[1]: Stopped The Apache HTTP Server.
Feb 26 15:09:19 myserv.mydom.com systemd[1]: Starting The Apache HTTP Server…
Feb 26 15:09:19 myserv.mydom.com apachectl[22618]: AH00526: Syntax error on line 41 of /etc/apache2/sites-enabled/bilbil.com-le-ssl.conf:
Feb 26 15:09:19 myserv.mydom.com apachectl[22618]: Invalid command ‘php_admin_value’, perhaps misspelled or defined by a module not included in the server configuration
Feb 26 15:09:19 myserv.mydom.com apachectl[22618]: Action ‘start’ failed.
Feb 26 15:09:19 myserv.mydom.com apachectl[22618]: The Apache error log may have more information.
Feb 26 15:09:19 myserv.mydom.com systemd[1]: apache2.service: Control process exited, code=exited status=1
Feb 26 15:09:19 myserv.mydom.com systemd[1]: apache2.service: Failed with result ‘exit-code’.
Feb 26 15:09:19 myserv.mydom.com systemd[1]: Failed to start The Apache HTTP Server.
What a mess…