简体   繁体   中英

How to set the php path when directly run php in command prompt

Hi I have configured php from source package and its install in /usr/local/bin/php the version was 5.2 but I have upgraded the PHP using yum repository to 5.4 which is installed in /usr/bin/php

whenever I type

root@server1:- which php 
/usr/local/bin/php

showing this path and version is

root@server1:- php -v 
PHP 5.2.6 (cli) (built: Oct  9 2013 07:08:43)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies

and when type

root@server1;- /usr/bin/php -v 
PHP 5.4.22 (cli) (built: Nov 18 2013 13:25:28)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
    with Zend Guard Loader v3.3, Copyright (c) 1998-2013, by Zend Technologies

how do i set a default path of php to 5.4 version no need to use full path while using php

please help me

.bash_profile设置bash别名:

alias php="/usr/bin/php"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM