'Enable PHP7 apache module - apache 2.4 - Linux Ubuntu 14

I have problem to use PHP 7.1 with apache.
I installed PHP 7.1:

apt-get install php7.1

I installed the PHP 7.1 apache module :

apt-get install libapache2-mod-php7.1

I disabled the PHP5 module :

sudo a2dismod php5

I enabled the PHP7 module :

sudo a2enmod php7.1

I restarted apache :

/etc/init.d/apache2 restart

When I check the apache loaded modules I see the PHP7 module :

apache2ctl -t -D DUMP_MODULES    >     php7_module (shared)

But when I make phpinfo() it is always PHP5 module.
Any idea ?
Thanks.



Solution 1:[1]

Sharing my experience of installing PHP 7.3.3 on Httpd 2.4.33 in Linux environment.

  1. When you run the configure command for installing PHP, ensure that apxs is also included.

--with-apxs2=/path/httpd/bin/apxs

  1. Once you install PHP, you can see that a module libphp7.so is installed in httpd/modules.
  2. In httpd.conf, add an entry LoadModule php7_module modules/libphp7.so
  3. Restart Apache.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Soumya Rajiv