# Installing php7.4 causing a series of problems

**URL:** <https://forum.virtualmin.com/t/installing-php7-4-causing-a-series-of-problems/104902>\
**Category:** Help! (Home for newbies)\
**Created:** [March 17, 2020, 4:11pm UTC](https://forum.virtualmin.com/t/installing-php7-4-causing-a-series-of-problems/104902 "2020-03-17T16:11:57Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![shenkwen](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/shenkwen/32/192_2.png) [@shenkwen](https://forum.virtualmin.com/u/shenkwen)\
**Post date:** [March 17, 2020, 4:11pm UTC](https://forum.virtualmin.com/t/installing-php7-4-causing-a-series-of-problems/104902/1 "2020-03-17T16:11:57Z")

</div>

My Ubuntu18.04 server was running well with multiple websites running under php7.2. Recently I was trying to upgrade my sites to php7.4 but haven’t been successful yet. I have lots of questions during the process.  
Basically I was following this guide: [https://linuxize.com/post/how-to-install-php-on-ubuntu-18-04/](https://linuxize.com/post/how-to-install-php-on-ubuntu-18-04/)  
The commands I executed are:

apt install software-properties-common  
add-apt-repository ppa:ondrej/php  
apt install libapache2-mod-php  
apt install php7.4 php7.4-common php7.4-opcache php7.4-cli php7.4-gd php7.4-curl php7.4-mysql

I also did the same for php7.3.  
All my websites are running under fcgi mode and I am not intended to use fpm, for now.

My first question is about the apache module. I noticed that after executing commands above, there are two new modules in webmin-\>servers-\>Apache Webserver-\>Global Configuration-\>Configure Apache Modules, they are php7.3 and php7.4. What do these modules do? It seems to me they are irrelevant if I run my site with fcgi, am I right? But they do have an impact on my site’s behavior - after I enable all of them or anyone of them other than php7.2 and restart apache server, my websites will start to download index.php file instead of executing it, can someone explain it to me or point me to some guide? And, if I disable them all, the apache server won’t start and give an error message saying  
“Starting apache2 (via systemctl): apache2.serviceJob for apache2.service failed because the control process exited with error code. See “systemctl status apache2.service” and “journalctl -xe” for details. failed!”

My second question is regarding the error log. While making sure only php7.2 module enabled( I am trying to install php7.4 I don’t understand why I have to enable 7.2 module but as I mentioned above if I don’t the server either won’t start or won’t execute PHP file ), I go to Virtualmin-\>Server Configuration-\>PHP Versions and change the version to 7.4.3, now when I open my Joomla websites, there will only be a blank screen with only one word on it: “Error”. Now according to my past experience, this usually means something wrong with connection with the mysql server. I check the mysql server it is running and all of my other websites running under 7.2 are good. So I go to “Logs and Reports-\>Apache Error Log” trying to find out what is wrong, but there is nothing there; meanwhile, I create a simple PHP file and put some error codes and phpinfo() in it, then try to open it with my browser. The error gets recorded in the “Apache Error Log” page and phpinfo shows php7.4.3. So, why the Joomla error was not recorded in the error log? Is there anything in the PHP script preventing that?

That’s a lot of questions, I never studied how to manage linux server and I don’t have time to. There are so much to learn and my strategy of learning is only learn what I have to. I hope someone can point me to the right direction or at least let me know what I have to learn to solve this. Thanks in advance.

P.S. I remember I encountered this problem before and I solved it with editting httpd.conf and some loadmodule script. Of course I was just blindly following some article I searched on Google. I am not suer if it is going to work this time, so before I tap into that water, I’d like to find out why simple installing PHP didn’t work and the .conf file has to be edited.

---

<div class="post-metadata">

**Author:** ![hescominsoon](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/hescominsoon/32/2358_2.png) [@hescominsoon](https://forum.virtualmin.com/u/hescominsoon)\
**Post date:** [March 17, 2020, 7:27pm UTC](https://forum.virtualmin.com/t/installing-php7-4-causing-a-series-of-problems/104902/2 "2020-03-17T19:27:48Z")

</div>

imo stick with 7.2 if you are running 18.04. it will be updated from ubuntu for as long as 18.04 is updated. HOwever 20.04 is out and it has php 7.4 natively. I would highly suggest you moving to 20.04 if you want to have php 7.4(virt support needs to be there first). Otherwise you are going outside of what virt does…and that gets interesting very quickly.

---

<div class="post-metadata">

**Author:** ![shenkwen](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/shenkwen/32/192_2.png) [@shenkwen](https://forum.virtualmin.com/u/shenkwen)\
**Post date:** [March 17, 2020, 10:57pm UTC](https://forum.virtualmin.com/t/installing-php7-4-causing-a-series-of-problems/104902/3 "2020-03-17T22:57:34Z")

</div>

I don’t think the problem has to do with php7.4. I encountered similar problems when I tried to upgrade from 5.6 to 7.0, 7.0 to 7.2, and also in the current machine I installed 7.3 and it has the same behavior.

---

<div class="post-metadata">

**Author:** ![Joe](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/joe/32/9_2.png) [@Joe](https://forum.virtualmin.com/u/Joe)\
**Post date:** [March 17, 2020, 11:15pm UTC](https://forum.virtualmin.com/t/installing-php7-4-causing-a-series-of-problems/104902/4 "2020-03-17T23:15:03Z")

</div>

Installing mod-php breaks things. Don’t do it.

Edit: To be clear…you do not need or want mod-php. It adds handler rules that break all of the Virtualmin PHP related configuration.

---

<div class="post-metadata">

**Author:** ![shenkwen](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/shenkwen/32/192_2.png) [@shenkwen](https://forum.virtualmin.com/u/shenkwen)\
**Post date:** [March 18, 2020, 11:01pm UTC](https://forum.virtualmin.com/t/installing-php7-4-causing-a-series-of-problems/104902/5 "2020-03-18T23:01:14Z")

</div>

when you say mod-php are you referring to libapache2-mod-php?

---

<div class="post-metadata">

**Author:** ![Joe](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/joe/32/9_2.png) [@Joe](https://forum.virtualmin.com/u/Joe)\
**Post date:** [March 19, 2020, 2:18am UTC](https://forum.virtualmin.com/t/installing-php7-4-causing-a-series-of-problems/104902/6 "2020-03-19T02:18:03Z")

</div>

Yes. It installs a configuration file that applies a PHP handler to all domains, breaking all domains.

---

<div class="post-metadata">

**Author:** ![Alecbarnes](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/a/ce73a5/32.png) [@Alecbarnes](https://forum.virtualmin.com/u/Alecbarnes)\
**Post date:** [March 24, 2020, 11:21am UTC](https://forum.virtualmin.com/t/installing-php7-4-causing-a-series-of-problems/104902/7 "2020-03-24T11:21:02Z")

</div>

I followed the same guide and it broke all sorts of things, in the end I ran the install.sh with --uninstall then ran it again to install Virtualmin. This sorted out most problems.

---

<div class="post-metadata">

**Author:** ![Joe](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/joe/32/9_2.png) [@Joe](https://forum.virtualmin.com/u/Joe)\
**Post date:** [April 11, 2020, 3:56am UTC](https://forum.virtualmin.com/t/installing-php7-4-causing-a-series-of-problems/104902/8 "2020-04-11T03:56:15Z")

</div>

Please don’t follow that guide! It gives bad advice (mod\_php is always bad advice).

But, you don’t need to reinstall Virtualmin. Just get rid of the mod\_php package and the config files it creates, and run a Configuration check so Virtualmin can find the changes.

---

<div class="post-metadata">

**Author:** ![system](https://cdn.forum.virtualmin.com/uploads/default/original/2X/c/cd96d761e326db4b2bef94886a639109bd7a8e76.svg) [@system](https://forum.virtualmin.com/u/system)\
**Post date:** [May 11, 2020, 3:56am UTC](https://forum.virtualmin.com/t/installing-php7-4-causing-a-series-of-problems/104902/9 "2020-05-11T03:56:17Z")

</div>

Closed on May 11, 2020, 3:56am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
