How to overwrite default php installation

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Anthony Smith

    How to overwrite default php installation

    On my linux system php seems to have been installed by default. When I
    type:

    "which php" it tells me /usr/bin/php

    I installed php and it has put an executable in the /usr/local/bin/php

    "which php" still says /usr/bin/php

    "whereis php"
    php: /etc/php.ini /usr/bin/php /usr/local/bin/php /usr/local/lib/php
    /usr/local/lib/php.ini

    /usr/local/lib/php -v shows the new version but php -v shows the old
    version.

    How can I correct this problem?

    I want to run the command php -v and it shows the newest version.

    I have already tried removing /etc/php.ini /usr/bin/php

  • m91.org@gmail.com

    #2
    Re: How to overwrite default php installation

    echo $PATH

    You can fix the problem by placing "/usr/local/lib/php" BEFORE
    "/usr/bin/php" in the PATH environment variable.
    On my linux system php seems to have been installed by default. When I
    type:
    >
    "which php" it tells me /usr/bin/php
    >
    I installed php and it has put an executable in the /usr/local/bin/php
    >
    "which php" still says /usr/bin/php
    >
    "whereis php"
    php: /etc/php.ini /usr/bin/php /usr/local/bin/php /usr/local/lib/php
    /usr/local/lib/php.ini
    >
    /usr/local/lib/php -v shows the new version but php -v shows the old
    version.
    >
    How can I correct this problem?
    >
    I want to run the command php -v and it shows the newest version.
    >
    I have already tried removing /etc/php.ini /usr/bin/php

    Comment

    • m91.org@gmail.com

      #3
      Re: How to overwrite default php installation

      echo $PATH

      To fix the problem try to set "/usr/local/bin" BEFORE
      "/usr/bin" in the PATH environment variable.
      On my linux system php seems to have been installed by default. When I
      type:
      >
      "which php" it tells me /usr/bin/php
      >
      I installed php and it has put an executable in the /usr/local/bin/php
      >
      "which php" still says /usr/bin/php
      >
      "whereis php"
      php: /etc/php.ini /usr/bin/php /usr/local/bin/php /usr/local/lib/php
      /usr/local/lib/php.ini
      >
      /usr/local/lib/php -v shows the new version but php -v shows the old
      version.
      >
      How can I correct this problem?
      >
      I want to run the command php -v and it shows the newest version.
      >
      I have already tried removing /etc/php.ini /usr/bin/php

      Comment

      Working...