LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   having trouble updating php-cli (https://www.linuxquestions.org/questions/linux-software-2/having-trouble-updating-php-cli-787874/)

wutanghax0r 02-08-2010 06:51 PM

having trouble updating php-cli
 
Hi. I have updated php on my fedora 6 installation.
when I run phpinfo from a browser it shows version 5.3.1
but when I run it form the command line it shows version 5.2.4
php-cli5.3.1 was installed when I updated. But I tried manually downloading and installing a php-cli5.3.1 rpm and as I suspected it told me it was already installed.
What Do I need to do to make my computer run php-cli5.3.1

ps. I know my fedora installation is old! ...but it's just a private local test box not accessible from the internet. :-p

kbp 02-09-2010 06:35 AM

All the php packages are built from the same src rpm so they should be the same version... maybe you have an extra version floating around:

can you do a 'which php' and compare it with -
Code:

    $ rpm -ql php-cli
    /usr/bin/phar
    /usr/bin/phar.phar
    /usr/bin/php
    /usr/bin/php-cgi
    /usr/share/doc/php-cli-5.3.1
    /usr/share/doc/php-cli-5.3.1/README
    /usr/share/doc/php-cli-5.3.1/README.FastCGI
    /usr/share/man/man1/php.1.gz

If it matches the correct location according to the rpm, then please verify the rpm to see if any files have been modified:

Code:

rpm -V php-cli
cheers

wutanghax0r 02-09-2010 03:13 PM

Thanks for your reply!!

It looks like they don't match:

# which php
/usr/local/bin/php

# rpm -ql php-cli
/usr/bin/phar
/usr/bin/phar.phar
/usr/bin/php
/usr/bin/php-cgi
/usr/share/doc/php-cli-5.3.1
/usr/share/doc/php-cli-5.3.1/README
/usr/share/doc/php-cli-5.3.1/README.FastCGI
/usr/share/man/man1/php.1.gz

I guess the /usr/local/bin/php is the old version
and /usr/bin/php is the current one. I ran phpinfo from the command line using /usr/bin/php and It showed version 5.3.1

What do I have to do to have that version be used when I just type:
php scriptname.php
from the command line. (sorry if this is a noob question :-] I'm learning)

kbp 02-09-2010 10:24 PM

Two choices: get rid of the old version or change your PATH order, probably simpler to get rid of the old version if you don't need it.

cheers

wutanghax0r 02-10-2010 10:23 AM

Awesome! :) I guess I assumed the new version wasn't in the path.
I removed the old php file and now php5.3.1 is used.
Thanks again!


All times are GMT -5. The time now is 08:36 PM.