Force linux to use php as php55

147 views Asked by At

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

2

There are 2 answers

2
Daan On BEST ANSWER

You can create an alias:

alias php="php55"

Now if you type php it uses php55

0
Machavity On

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