Ubuntu – How to enable PHP 7.3 in Apache2

Apache2php7

I followed the instructions in https://idroot.us/install-php-7-3-ubuntu-18-04/ to install PHP 7.3 and then, as instructed, ran

a2enmod proxy_fcgi setenvif

a2enconf php7.3-fpm

to enable it in Apache2.

systemctl status php7.3-fpm

confirms that php7.3 is installed and running and I did restart Apache2 using

systemctl restart apache2

php -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

Best Answer

You have to disable the older version of PHP (a2dismod [oldversion]) and then enable the new version with

sudo a2enmod php7.3

Then restart apache2

Related Question