The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

php -v showing old version

Discussion in 'General Discussion' started by mohsyn, Nov 20, 2005.

Thread Status:
Not open for further replies.
  1. mohsyn

    mohsyn Member

    Joined:
    May 25, 2005
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Hello,

    I recently upgraded php via WHM to 5.0.5 so I could install some pecl packages that required PHP 5. PHP 5 installed successfully however typing php -v in ssh shows 4.3.11 which is the old version. However apache is running 5.0.5 as shown in phpinfo(). Please somebody help me with this issue.
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    It's the same issue that's been in the various php v4.4.1 threads, so a search of the forum for those would give you the cause. Basically, you need to specify the correct path to the php binary which the search path from shell isn't doing.
     
  3. mohsyn

    mohsyn Member

    Joined:
    May 25, 2005
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Okay I changed the PHP version to 4.4.1 and it still reports PHP 4.3.11 in ssh. There must be two copies of php running on the server surely.
     
  4. rhenderson

    rhenderson Well-Known Member

    Joined:
    Apr 21, 2005
    Messages:
    785
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Oklahoma
    cPanel Access Level:
    Root Administrator
    May be, where are you running the php -v command from? Try running which php to see which folder php is running from then go to that folder and run php -v
     
  5. AndyReed

    AndyReed Well-Known Member
    PartnerNOC

    Joined:
    May 29, 2004
    Messages:
    2,222
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Minneapolis, MN
    Many of our clients have had this problem and it is very easy to fix. You need to re-compile Php, manually, at the prompt. You also need to watch for any error messages when compiling Php.
     
  6. Zaf

    Zaf Well-Known Member

    Joined:
    Aug 22, 2005
    Messages:
    119
    Likes Received:
    0
    Trophy Points:
    16
    There are indeed many threads here discussing the same issue, you may do the following:
    1. At shell prompt:
    # type -a php | cut -d\ -f3 | xargs ls -l --
    It will tell you exactly how many executables with that name exist on your server with their timestamps. Compare the timestamp with the latest Apache rebuild time and you'd know the correct php version you need.
    2. Now there are two options:
    a. Either you delete the old php binaries (rm -f /path/to/the/old/binary)
    b. Symlink the old binaries to point to the new binary (ln -s -f /path/to/the/new/binary /path/to/the/old/binary)

    Please note there are other files related to php which might be duplicated on the server and they are: phpize, phpextdist, php-config, pear

    Lastly, dont think you need to re-compile PHP if it were installed as Apache module, just follow the above instructions

    Hth
     
    #6 Zaf, Nov 21, 2005
    Last edited: Nov 21, 2005
  7. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    You definitely do not need to recompile php, that's pointless. The issue has already been discussed at length.

    Please read the existing php thread on the topic as I mentioned earlier. BTW, there was no need to install php v4.4.1, I merely told you to look for that thread:
    http://forums.cpanel.net/showthread.php?t=45969

    Feel free to continue the discussion there rather than fracture it in a new thread.
     
    #7 chirpy, Nov 21, 2005
    Last edited: Nov 21, 2005
Loading...
Thread Status:
Not open for further replies.

Share This Page