48

教你如何快速切换Linux PHP版本

 5 years ago
source link: https://www.linuxprobe.com/linux-php-qiehuan.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
导读 今天在帮别人安装一个不知所谓的东西时碰到,三版本的PHP环境,我感觉那个人也是666哒,他使用的是AMH快速开发工具,然后就顺便写下怎么快速、简便切换php版本。

有图有真相!!!

首先:find命令找下php在哪里先

#find / -name php

第一步:ln命令(百度下大把资源)主要用来创建软连接

现在主要是想将5.4版本换5.5版本:

#ln -s /usr/local/php-5.5/bin/php(你想要换成的php版本的路径) /usr/sbin/php(最后一个php可以换成你自己喜欢的名字,最好php吧)

第二步:export命令将软连接加到PATH路径中

#export PATH="$PATH:/usr/sbin/php"(将上面你准备好的连接加进去就可以了,中间:冒号别漏了,用来做分割的)

最后:看下效果

#php -v


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK