two different php installs
-
- Posts: 51
- Joined: 2012/07/06 23:57:24
two different php installs
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.
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.
Re: two different php installs
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
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
-
- Posts: 51
- Joined: 2012/07/06 23:57:24
Re: two different php installs
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 ?
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 ?
Re: two different php installs
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
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
-
- Posts: 51
- Joined: 2012/07/06 23:57:24
Re: two different php installs
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.
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.
Re: two different php installs
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
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
-
- Posts: 51
- Joined: 2012/07/06 23:57:24
Re: two different php installs
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
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
-
- Posts: 51
- Joined: 2012/07/06 23:57:24
Re: two different php installs
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.
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.
Re: two different php installs
> 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.
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.