Link to home
Start Free TrialLog in
Avatar of Eduardo Fuerte
Eduardo FuerteFlag for Brazil

asked on

Could you point how to solve this PHP versions conflict?

Hi Experts

Could you point how to solve this PHP versions conflict?

I guess it's preventing PHP pages to be renderized.

xxe@xxe-Inspiron-1525:/etc/apache2$ ls -l mods-*/*php*
-rw-r--r-- 1 root root 855 mar 14 19:30 mods-available/php7.1.conf
-rw-r--r-- 1 root root 102 mar 14 19:30 mods-available/php7.1.load
-rw-r--r-- 1 root root 855 mai  9 14:21 mods-available/php7.2.conf
-rw-r--r-- 1 root root 102 mai  9 14:21 mods-available/php7.2.load

HTML pages are renderized by Apache, not PHP pages.

Thanks in advance!
Avatar of Ayoub Rouzi
Ayoub Rouzi
Flag of France image

Eduardo,

it's often a php version conflict, could you please tell us which php version are you using ?
Avatar of Eduardo Fuerte

ASKER

Well

Accordingly with my own question:

The versions installed are pointed at the question.
PHP  doesn't works out.
That it's a version conflict I had concluded and pointed at the question.
The output of php -v will give you what is your default version.

Use following commands to view if you have any traces:

cd /etc/apache2/mods-enabled
ls -la

Open in new window


We suppose we want to upgrade From PHP 5.6 to PHP 7.1: (which the console tell you that you need some modules for.

If so then use following commands:

sudo a2dismod php5.6
sudo rm php5*

Open in new window


Now add the php7.1.conf and php7.1.load instead:

sudo a2enmod php7.1
sudo update-alternatives --set php /usr/bin/php7.1
sudo ln -s php7.1.conf ../mods-available/php7.1.conf
sudo ln -s php7.1.load ../mods-available/php7.1.load
sudo service apache2 restart

Open in new window


UPDATE: Replace 5.6 with the php version that you have (result of :
cd /etc/apache2/mods-enabled
ls -la

Open in new window

Going your sequece.
Reproducing here the results.

marianne@marianne-Inspiron-1525:/etc/apache2/mods-enabled$ php -v 
PHP 7.2.5-0ubuntu0.18.04.1 (cli) (built: May  9 2018 17:21:02) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.5-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by Zend Technologies

Open in new window


marianne@marianne-Inspiron-1525:/etc/apache2/mods-enabled$ ls -la
total 8
drwxr-xr-x 2 root root 4096 mai 30 12:43 .
drwxr-xr-x 8 root root 4096 mai 30 12:43 ..
lrwxrwxrwx 1 root root   36 mai 30 12:43 access_compat.load -> ../mods-available/access_compat.load
lrwxrwxrwx 1 root root   28 mai 30 12:43 alias.conf -> ../mods-available/alias.conf
lrwxrwxrwx 1 root root   28 mai 30 12:43 alias.load -> ../mods-available/alias.load
lrwxrwxrwx 1 root root   33 mai 30 12:43 auth_basic.load -> ../mods-available/auth_basic.load
lrwxrwxrwx 1 root root   33 mai 30 12:43 authn_core.load -> ../mods-available/authn_core.load
lrwxrwxrwx 1 root root   33 mai 30 12:43 authn_file.load -> ../mods-available/authn_file.load
lrwxrwxrwx 1 root root   33 mai 30 12:43 authz_core.load -> ../mods-available/authz_core.load
lrwxrwxrwx 1 root root   33 mai 30 12:43 authz_host.load -> ../mods-available/authz_host.load
lrwxrwxrwx 1 root root   33 mai 30 12:43 authz_user.load -> ../mods-available/authz_user.load
lrwxrwxrwx 1 root root   32 mai 30 12:43 autoindex.conf -> ../mods-available/autoindex.conf
lrwxrwxrwx 1 root root   32 mai 30 12:43 autoindex.load -> ../mods-available/autoindex.load
lrwxrwxrwx 1 root root   30 mai 30 12:43 deflate.conf -> ../mods-available/deflate.conf
lrwxrwxrwx 1 root root   30 mai 30 12:43 deflate.load -> ../mods-available/deflate.load
lrwxrwxrwx 1 root root   26 mai 30 12:43 dir.conf -> ../mods-available/dir.conf
lrwxrwxrwx 1 root root   26 mai 30 12:43 dir.load -> ../mods-available/dir.load
lrwxrwxrwx 1 root root   26 mai 30 12:43 env.load -> ../mods-available/env.load
lrwxrwxrwx 1 root root   29 mai 30 12:43 filter.load -> ../mods-available/filter.load
lrwxrwxrwx 1 root root   27 mai 30 12:43 mime.conf -> ../mods-available/mime.conf
lrwxrwxrwx 1 root root   27 mai 30 12:43 mime.load -> ../mods-available/mime.load
lrwxrwxrwx 1 root root   32 mai 30 12:43 mpm_event.conf -> ../mods-available/mpm_event.conf
lrwxrwxrwx 1 root root   32 mai 30 12:43 mpm_event.load -> ../mods-available/mpm_event.load
lrwxrwxrwx 1 root root   34 mai 30 12:43 negotiation.conf -> ../mods-available/negotiation.conf
lrwxrwxrwx 1 root root   34 mai 30 12:43 negotiation.load -> ../mods-available/negotiation.load
lrwxrwxrwx 1 root root   33 mai 30 12:43 reqtimeout.conf -> ../mods-available/reqtimeout.conf
lrwxrwxrwx 1 root root   33 mai 30 12:43 reqtimeout.load -> ../mods-available/reqtimeout.load
lrwxrwxrwx 1 root root   31 mai 30 12:43 setenvif.conf -> ../mods-available/setenvif.conf
lrwxrwxrwx 1 root root   31 mai 30 12:43 setenvif.load -> ../mods-available/setenvif.load
lrwxrwxrwx 1 root root   29 mai 30 12:43 status.conf -> ../mods-available/status.conf
lrwxrwxrwx 1 root root   29 mai 30 12:43 status.load -> ../mods-available/status.load
marianne@marianne-Inspiron-1525:/etc/apache2/mods-enabled$ 

Open in new window



Considering the version of PHP is 7.2.5  (5.6 wasn't installed)
marianne@marianne-Inspiron-1525:/etc/apache2/mods-enabled$ sudo a2enmod php7.2.5
ERROR: Module php7.2.5 does not exist!
marianne@marianne-Inspiron-1525:/etc/apache2/mods-enabled$ sudo a2enmod php7.2
Considering dependency mpm_prefork for php7.2:
Considering conflict mpm_event for mpm_prefork:
ERROR: Module mpm_event is enabled - cannot proceed due to conflicts. It needs to be disabled first!
Considering conflict mpm_worker for mpm_prefork:
ERROR: Could not enable dependency mpm_prefork for php7.2, aborting

Open in new window


Using  for 7.2
marianne@marianne-Inspiron-1525:/etc/apache2/mods-enabled$ sudo update-alternatives --set php /usr/bin/php7.2
marianne@marianne-Inspiron-1525:/etc/apache2/mods-enabled$ sudo ln -s php7.1.conf ../mods-available/php7.2.conf
ln: falha ao criar link simbólico '../mods-available/php7.2.conf': Arquivo existe
marianne@marianne-Inspiron-1525:/etc/apache2/mods-enabled$ sudo ln -s php7.1.load ../mods-available/php7.2.load
ln: falha ao criar link simbólico '../mods-available/php7.2.load': Arquivo existe
marianne@marianne-Inspiron-1525:/etc/apache2/mods-enabled$ sudo service apache2 restart

Open in new window


marianne@marianne-Inspiron-1525:/etc/apache2/mods-enabled$ cd /etc/apache2/mods-enabled
marianne@marianne-Inspiron-1525:/etc/apache2/mods-enabled$ ls -la
total 8
drwxr-xr-x 2 root root 4096 mai 30 12:43 .
drwxr-xr-x 8 root root 4096 mai 30 12:43 ..
lrwxrwxrwx 1 root root   36 mai 30 12:43 access_compat.load -> ../mods-available/access_compat.load
lrwxrwxrwx 1 root root   28 mai 30 12:43 alias.conf -> ../mods-available/alias.conf
lrwxrwxrwx 1 root root   28 mai 30 12:43 alias.load -> ../mods-available/alias.load
lrwxrwxrwx 1 root root   33 mai 30 12:43 auth_basic.load -> ../mods-available/auth_basic.load
lrwxrwxrwx 1 root root   33 mai 30 12:43 authn_core.load -> ../mods-available/authn_core.load
lrwxrwxrwx 1 root root   33 mai 30 12:43 authn_file.load -> ../mods-available/authn_file.load
lrwxrwxrwx 1 root root   33 mai 30 12:43 authz_core.load -> ../mods-available/authz_core.load
lrwxrwxrwx 1 root root   33 mai 30 12:43 authz_host.load -> ../mods-available/authz_host.load
lrwxrwxrwx 1 root root   33 mai 30 12:43 authz_user.load -> ../mods-available/authz_user.load
lrwxrwxrwx 1 root root   32 mai 30 12:43 autoindex.conf -> ../mods-available/autoindex.conf
lrwxrwxrwx 1 root root   32 mai 30 12:43 autoindex.load -> ../mods-available/autoindex.load
lrwxrwxrwx 1 root root   30 mai 30 12:43 deflate.conf -> ../mods-available/deflate.conf
lrwxrwxrwx 1 root root   30 mai 30 12:43 deflate.load -> ../mods-available/deflate.load
lrwxrwxrwx 1 root root   26 mai 30 12:43 dir.conf -> ../mods-available/dir.conf
lrwxrwxrwx 1 root root   26 mai 30 12:43 dir.load -> ../mods-available/dir.load
lrwxrwxrwx 1 root root   26 mai 30 12:43 env.load -> ../mods-available/env.load
lrwxrwxrwx 1 root root   29 mai 30 12:43 filter.load -> ../mods-available/filter.load
lrwxrwxrwx 1 root root   27 mai 30 12:43 mime.conf -> ../mods-available/mime.conf
lrwxrwxrwx 1 root root   27 mai 30 12:43 mime.load -> ../mods-available/mime.load
lrwxrwxrwx 1 root root   32 mai 30 12:43 mpm_event.conf -> ../mods-available/mpm_event.conf
lrwxrwxrwx 1 root root   32 mai 30 12:43 mpm_event.load -> ../mods-available/mpm_event.load
lrwxrwxrwx 1 root root   34 mai 30 12:43 negotiation.conf -> ../mods-available/negotiation.conf
lrwxrwxrwx 1 root root   34 mai 30 12:43 negotiation.load -> ../mods-available/negotiation.load
lrwxrwxrwx 1 root root   33 mai 30 12:43 reqtimeout.conf -> ../mods-available/reqtimeout.conf
lrwxrwxrwx 1 root root   33 mai 30 12:43 reqtimeout.load -> ../mods-available/reqtimeout.load
lrwxrwxrwx 1 root root   31 mai 30 12:43 setenvif.conf -> ../mods-available/setenvif.conf
lrwxrwxrwx 1 root root   31 mai 30 12:43 setenvif.load -> ../mods-available/setenvif.load
lrwxrwxrwx 1 root root   29 mai 30 12:43 status.conf -> ../mods-available/status.conf
lrwxrwxrwx 1 root root   29 mai 30 12:43 status.load -> ../mods-available/status.load

Open in new window


Unfortunatelly, PHP pages still are not renderized.
ASKER CERTIFIED SOLUTION
Avatar of Eduardo Fuerte
Eduardo Fuerte
Flag of Brazil image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Doing this way worked out for me.