[CentOS] Wrong version of php

Mon Jun 22 20:38:00 UTC 2020
Valeri Galtsev <galtsev at kicp.uchicago.edu>


On 6/22/20 3:27 PM, H wrote:
> It's been a while since I updated to php72 on this machine and there is some setting I must have forgotten. Apache, root and a user automatically get php72 when I run php in a terminal window, however, a php script picks up the wrong version of php, ie php54 and the version of php in /usr/bin/php is indeed version 5.4.
> 

I would find out which package it indeed belongs to:

rpm -qf /usr/bin/php

I would also find out the name or package that brings PHP 7.2, like:

rpm -qa | grep php

and then list all files in that package, say, if it is php-7.2, then

rpm -ql php-7.2 | less


You will see the mame of executable to invoke php72, in the list above 
could be something like

/usr/bin/php72


Note, I do not run php on Linux anymore, but the above are educated 
guesses how multiple concurrent packages layed out to not interfere with 
each other.


Valeri


> I have googled without finding the answer but how do I make sure /all/ processes use php72 rather than the default 54 in CentOS 7? Surely there must be a better way than overwriting /usr/bin/php. What have I forgotten to do?
> 
> Thank you.
> 
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> https://lists.centos.org/mailman/listinfo/centos
> 

-- 
++++++++++++++++++++++++++++++++++++++++
Valeri Galtsev
Sr System Administrator
Department of Astronomy and Astrophysics
Kavli Institute for Cosmological Physics
University of Chicago
Phone: 773-702-4247
++++++++++++++++++++++++++++++++++++++++