duanji4870 2016-03-07 06:58
浏览 247

linux(Centos7)| 我有两个php.ini文件

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

  • 写回答

1条回答 默认 最新

  • dongzha2525 2016-03-11 20:52
    关注

    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

    评论

报告相同问题?

悬赏问题

  • ¥100 求数学坐标画圆以及直线的算法
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 自己瞎改改,结果现在又运行不了了
  • ¥15 链式存储应该如何解决
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站