user3503072
user3503072

Reputation: 467

linux(Centos7) | I have two php.ini files

I installed the apm on my Linux (Centos7) and i think i installed the php again with yum.

I have two php.ini file in the paths below.

/usr/loacal/php/bin/php.ini (v5.3)
/etc/php.ini (v5.4)


php -v
PHP 5.4.16 (cli) (built: Jun 23 2015 21:17:27)

/usr/local/php/bin/php -v
PHP 5.3.27 (cli) (built: Mar  3 2016 11:17:12)

I have two versions of php on one server right now.

rpm -qa | grep php 

php-pdo-5.4.16-36.el7_1.x86_64
php-tcpdf-6.2.11-1.el7.noarch
php-tidy-5.4.16-3.el7.x86_64
php-xml-5.4.16-36.el7_1.x86_64
php-mbstring-5.4.16-36.el7_1.x86_64
php-cli-5.4.16-36.el7_1.x86_64
php-php-gettext-1.0.11-12.el7.noarch
php-bcmath-5.4.16-36.el7_1.x86_64
php-gd-5.4.16-36.el7_1.x86_64
php-process-5.4.16-36.el7_1.x86_64
php-common-5.4.16-36.el7_1.x86_64
php-mysql-5.4.16-36.el7_1.x86_64
php-tcpdf-dejavu-sans-fonts-6.2.11-1.el7.noarch

I think this all files are installed with php(v5.4) I can I remove these?

Can i just use the yum command again like below?

yum remove php

I'm so afraid that something happens when i do that. Please let me know how to deal with this situation... Thanks

Upvotes: 0

Views: 711

Answers (1)

Harry
Harry

Reputation: 11638

You might not need to remove anything. You can have as many versions of PHP installed as you like. The PATHS etc determine what actually gets used. To see what php binary is being used on command line use

which php 

To see what php.ini file is being used by that binary use

php -i |grep "php.ini"

If you have the correct one then you're probably fine. To see what files will be remove by removing packages you can query the package to get the file list ie

rpm -ql php-common-5.4.16-36.el7_1.x86_64

The common package should contain the php.ini file that gets installed. From these commands you should be able to work out if you want to remove anything.

Note, if you can, use the more modern versions of PHP that you have installed. PHP 5.3 and 5.4 are both considered old versions now and are no longer supported.

https://en.wikipedia.org/wiki/PHP#Release_history

Upvotes: 1

Related Questions