Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 7072

How can I use Php7.4 in my Apache in Ubuntu 22?

$
0
0

Recently I upgrade my Ubuntu from 20 to 22. I was using Php7.4 in Ubuntu 20 with the Apache server. After upgrading to Ubuntu 22, the Php Upgrades to 8.1 automatically. After that, I install Php7.4 also in my system. I can switch PHP version by using this command:

sudo update-alternatives --config php

If I use terminal I can see different PHP versions using php -v. But I am unable to use Php7.4 in apache. I am trying to install using this command:

sudo apt-get install libapache2-mod-php7.4

But it's giving me the following error:

Reading package lists... DoneBuilding dependency tree... DoneReading state information... DoneSome packages could not be installed. This may mean that you haverequested an impossible situation or if you are using the unstabledistribution that some required packages have not yet been createdor been moved out of Incoming.The following information may help to resolve the situation:The following packages have unmet dependencies: libapache2-mod-php7.4 : Depends: php8.1-common (= 8.1.2-1ubuntu2) but 8.1.5-1+ubuntu22.04.1+deb.sury.org+1.1 is to be installedE: Unable to correct problems, you have held broken packages.

Again if I try to activate Php7.4 in apache using this command:

sudo a2enmod php7.4

I am getting this error:

ERROR: Module php7.4 does not exist!

Now how can I use Php7.4 in my Apache? Note, that Apache was installed in Ubuntu 20.


Viewing all articles
Browse latest Browse all 7072

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>