How do I enable PHP 7.3 in Apache2
By Daniel Rodriguez •
I followed the instructions in to install PHP 7.3 and then, as instructed, ran
a2enmod proxy_fcgi setenvif
a2enconf php7.3-fpmto enable it in Apache2.
systemctl status php7.3-fpmconfirms that php7.3 is installed and running and I did restart Apache2 using
systemctl restart apache2php -v reports PHP 7.3.6-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: May 31 2019 11:06:48) ( NTS )
However, phpinfo(); reports PHP 7.2: PHP Version 7.2.17-0ubuntu0.18.04.1
What have I missed? Any guidance would be appreciated as I'm totally new to Ubuntu.
Thanks
2 Answers
You have to disable the older version of PHP (a2dismod [oldversion]) and then enable the new version with
sudo a2enmod php7.3Then restart apache2
3In my case I had to do the following
sudo add-apt-repository ppa:ondrej/php
sudo apt-get install php7.3 php7.3-cli php7.3-mysql php7.3-gd php7.3-imagick php7.3-recode php7.3-tidy php7.3-xmlrpc php7.3-common php7.3-curl php7.3-mbstring php7.3-xml php7.3-bcmath php7.3-bz2 php7.3-intl php7.3-json php7.3-readline php7.3-zip
sudo apt install libapache2-mod-php7.3
sudo a2enmod php7.3After install apache still used php7.0, so I had to remove 7.0 configs manually:
cd /etc/apache2/mods-enabled
ls -la | grep php
sudo rm php7.0.confAnd finally
sudo service apache2 restart 4 More in general
"Zoraya ter Beek, age 29, just died by assisted suicide in the Netherlands. She was physically healthy, but psychologically depressed. It's an abomination that an entire society would actively facilitate, even encourage, someone ending their own life because they had no hope. Th…"