2015-06-22 13:07
浏览 59


Helllo, I have a little problem here.

I have PHP 5.3 installed and it's accessible via php command, I also have php 5.5 accessible as php55 command.

Now I need to force linux to use php55 when I write php command.

Simple way: How I switch the versions of php?

I am using Fedora 21 OS

图片转代码服务由CSDN问答提供 功能建议

Helllo, 这里有一点问题。

我有PHP 5.3安装并且可以通过 php 命令访问,我也可以通过 php55 命令访问php 5.5。

现在我需要强制linux 在编写 php 命令时使用 php55


我正在使用Fedora 21 OS

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • duanhuan6857 2015-06-22 13:08

    You can create an alias:

    alias php="php55"

    Now if you type php it uses php55

    打赏 评论
  • douzhan1031 2015-06-22 13:18

    PHP typically installs its binary at /usr/bin/php (not all installs might do that tho, so YMMV). So what you could do is symlink the PHP binary to your php55 command like this (assumes the paths are correct)

    ln -s /path/to/php55 /usr/bin/php
    打赏 评论

相关推荐 更多相似问题