Home > Article > Backend Development > How to change php version number in linux
How to change the PHP version number in Linux: First use the "find" command to find the location of each PHP version; then use the "ln" command to create a soft link containing the path to the new PHP version; finally use the "export" command Just add the soft link to the PATH path.
The operating environment of this article: centos7 system, PHP5.4&&PHP5.5 version, thinkpad t480 computer
Operation steps:
1. Use the find command to find where php is.
#find / -name php
2. The ln command (a lot of resources on Baidu) is mainly used to create soft connections
Now I mainly want to change the 5.4 version to the 5.5 version:
#ln -s /usr/local/php-5.5/bin/php(你想要换成的php版本的路径) /usr/sbin/php(最后一个php可以换成你自己喜欢的名字,最好php吧)
3. The export command will add the soft connection to the PATH path
#export PATH="$PATH:/usr/sbin/php"
Add the connection you prepared above That’s it, don’t miss the colon in the middle, it’s used for segmentation
Finally, look at the effect
#php -v
Recommended tutorial: php Video tutorial, Linux video tutorial
The above is the detailed content of How to change php version number in linux. For more information, please follow other related articles on the PHP Chinese website!