0

I've a server running Centos 5. Yesterday I upgraded php to 5.4.10 throught remi repository. Operation was successful ( I've checked updated information in phpinfo()) Today I figured out that php launched from shell, displays a different version (5.2.16). This version is the previous one. If I do

which php 

output is: /usr/local/bin/php while the new php 5.4 binary is /usr/bin/php

From what I understood, php was manually compiled in the system and there are no source installation files around.

How can I change the path usr/local/bin/php to /usr/bin/php. I dont'k know where to look for.

4
  • 1
    Just try removing the PHP that was installed to /usr/local. Commented Jan 12, 2013 at 17:34
  • I've already done it, but with no luck. php from command line stopped working until I created a symlink ln -s /usr/bin/php /usr/local/bin/php. Btw symlink is not a solution because other commands rely on that path such as pear command. so I need to change this path at the root (I'd like to know where this path is stored in). Commented Jan 12, 2013 at 18:07
  • Just log out and log back in. Commented Jan 12, 2013 at 19:13
  • @MichaelHampton logged out without any luck. Commented Jan 15, 2013 at 10:36

1 Answer 1

0

After digging into documentation and others great Linux stuffs I've found the solution. All depends from $PATH environment variable, specifically from the order of the directory listed in.

#original $PATH echo $PATH /usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin 

So, I moved /usr/local/bin at the end of the string, and everything start working again:

export PATH=/usr/bin:/usr/sbin:/bin:/sbin:/usr/local/bin 

Now I've to make this edit persistent, because export instruction expires with session end.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.