two different php installs

Issues related to applications and software problems
Post Reply
edwardsmarkf
Posts: 51
Joined: 2012/07/06 23:57:24

two different php installs

Post by edwardsmarkf » 2019/02/11 18:36:11

hello -

over the past few years, i have attempted to upgrade php from 5.4 to 7.0 and then to 5.6 and then back to 5.4. i did NOT really know what i was doing, and that seems to have come back to haunt me.

over the weekend, i removed all php installations (or so i thought i did) using yum. i especially wanted to remove rh-php56, which i did. then i installed just php5.6 by doing:

yum --assumeyes install https://dl.fedoraproject.org/pub/epel/e ... noarch.rpm ;
yum --assumeyes install http://rpms.remirepo.net/enterprise/remi-release-7.rpm ;
yum --assumeyes install yum-utils;
yum-config-manager --enable remi-php56 [Intall PHP 5.6] ;
yum --assumeyes install php php-common etc etc etc etc etc

yum list installed | grep php ;
php.x86_64 5.6.40-1.el7.remi @remi-php56
php-cli.x86_64 5.6.40-1.el7.remi @remi-php56
blah blah blah blah
php-xmlrpc.x86_64 5.6.40-1.el7.remi @remi-php56

now when i do `which php` i see "/usr/local/bin/php -> /usr/bin/php", and when i issue the command "php --version" indeed i am now seeing php 5.6.40.

however, when i do "/bin/php --version" i also see 5.6.40

so in other words, i am seeing two php installs:

# ls -l /bin/php /usr/bin/php ;
-rwxr-xr-x 1 root root 4410872 Jan 9 06:37 /bin/php
-rwxr-xr-x 1 root root 4410872 Jan 9 06:37 /usr/bin/php

# /bin/php --version ; /usr/bin/php --version ;
PHP 5.6.40 (cli) (built: Jan 9 2019 12:34:16)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
PHP 5.6.40 (cli) (built: Jan 9 2019 12:34:16)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

my question: does this hurt anything? is this normal? i am tempted to remove one and set up an "ln -s" or something like that, but i wanted to run it by some of the wizards in this excellent forum first.

User avatar
TrevorH
Site Admin
Posts: 33215
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: two different php installs

Post by TrevorH » 2019/02/11 19:08:28

If you have something under /usr/local then that looks like you installed from source. Nothing that we ship installs under there and I'm pretty sure that nothing Remi ships does either. You'll need to do a make uninstall or whatever the reverse of make install is for php.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

edwardsmarkf
Posts: 51
Joined: 2012/07/06 23:57:24

Re: two different php installs

Post by edwardsmarkf » 2019/02/11 19:20:19

Trevor - one of these days i need to take you out for an expensive lunch. That is, assuming somehow you survive Brexit.

so are you saying that i should remove all the php installs and start over again? i probably created that "ln -s" some time back in an attempt to clean up a mistake i made.

but my original question, which php is the "correct" install? the /bin/php or the /usr/bin/php ?

User avatar
TrevorH
Site Admin
Posts: 33215
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: two different php installs

Post by TrevorH » 2019/02/11 19:26:19

Try running ls -la / and look at the directory entry for /bin ...
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

edwardsmarkf
Posts: 51
Joined: 2012/07/06 23:57:24

Re: two different php installs

Post by edwardsmarkf » 2019/02/11 19:34:39

dang - how embarrassing is that??

ls -la /bin
lrwxrwxrwx 1 root root 7 May 10 2018 /bin -> usr/bin

so it would appear to most people with any intelligence (excluding me) that there is indeed only one install of php.

well, the good news is that it appears my cleanup effort worked successfully.

the bad news is that i have humiliated myself in a public forum.

Trevor, once again, thank you for your years of dedicated support to this forum. and happy Brexit.

Now, onward to figure out why Apache is being so weird about all of this.

User avatar
TrevorH
Site Admin
Posts: 33215
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: two different php installs

Post by TrevorH » 2019/02/11 19:40:50

Be aware that php 5.6 is or is about to be, EOL so there will be no more updates to it.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke


User avatar
TrevorH
Site Admin
Posts: 33215
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: two different php installs

Post by TrevorH » 2019/02/11 20:05:55

Both IUS and Remi offer php 7.2 packages and there are also a series of rh-php72* and sclo-php72* packages available from SCL
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

edwardsmarkf
Posts: 51
Joined: 2012/07/06 23:57:24

Re: two different php installs

Post by edwardsmarkf » 2019/02/14 20:40:08

i forget: was Remi or Epel better? for yum people, one caused potential issues.

update on issue: i have hired an expert, since i am unable to get the problem resolved. now when i create a new virtual-machine (on virtualmin) i cant seem to run a simple php script anymore without it downloading. at least that is what happens on fcgi.

i will post back what the expensive consultant has to say.

User avatar
remirepo
Posts: 447
Joined: 2014/09/21 09:07:12
Location: France
Contact:

Re: two different php installs

Post by remirepo » 2019/02/15 07:38:19

> i forget: was Remi or Epel better?

Different repo, different goal, nothing to compare

EPEL provides only additional packages, and don't replace anything from base repository (ex, no recent PHP versions, and extension for PHP 5.4 is base repo). This is a community driven repo.

Remi provides additional packages, and additional versions, and parallel installable versions (SCL) and packages which replace some base packages (ex: PHP 7.1, 7.2, 7.3...). If only using "remi-safe", everything is really safe, no replacement, no conflict. If using one of the "remi-phpXX" you will replace PHP and only PHP.
Remi's Repository - Forum - Blog

Post Reply