duan7772 2017-02-16 19:55
浏览 202

CentOS ./configure - 如何使用备用PHP版本

I am quite new to CentOS. On my CentOS web server I have PHP 5.4.16 as a native PHP version though I also have alternate PHP version 7.0. I am trying to install xDebug for PHP 7.0 following the instruction on https://xdebug.org and one of the steps is to run

./configure

When I run ./configure command I am getting error message:

not supported. Need a PHP version >= 5.5.0 and < 7.2.0 (found 5.4.16)

So my question is how do I tell ./configure to use alternate PHP version 7.0?

  • 写回答

1条回答 默认 最新

  • dqthn68688 2017-02-17 00:00
    关注

    If you run php -v on command line, it will output the version of PHP it is currently on your PATH. My guess is that it will return the older version of PHP as the result.

    The quick and dirty way to try and get it to use version 7.0 for your current shell session would be to run the following

    set PATH="/your/path/to/php7/bin:$PATH"
    php -v
    //Should output version 7.0
    

    You could also try checking in /usr/bin or /usr/local/bin to see exactly which PHP binary it's pointing to, and manually change the location that the symlinks are pointing to.

    Another option would be to try creating an alias in your ~/.bashrc file for PHP by editing the file and adding the following to the end:

    alias php="/your/path/to/php/7/bin/php"
    

    Then restart your shell session (i.e. close an & re-open PuTTY or whichever SSH client you're using).

    Now type php -v and you should see it change to version 7.0.

    评论

报告相同问题?

悬赏问题

  • ¥15 yolov7训练自己的数据集
  • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
  • ¥15 电力市场出清matlab yalmip kkt 双层优化问题
  • ¥30 ros小车路径规划实现不了,如何解决?(操作系统-ubuntu)
  • ¥20 matlab yalmip kkt 双层优化问题
  • ¥15 如何在3D高斯飞溅的渲染的场景中获得一个可控的旋转物体
  • ¥88 实在没有想法,需要个思路
  • ¥15 MATLAB报错输入参数太多
  • ¥15 python中合并修改日期相同的CSV文件并按照修改日期的名字命名文件
  • ¥15 有赏,i卡绘世画不出