Home > Article > Backend Development > How to change php version in linux
How to change the php version in Linux: First use the find command to find the location of php; then create a soft link through the ln command; then use the export command to add the soft link to the PATH path; finally use "#php -v ” command to view the change results.
Recommendation: "PHP Video Tutorial"
Super simple way to switch between multiple versions of Linux PHP
First: find command to find where php is first
#find / -name php
The first step: ln command (a lot of resources under Baidu) is mainly used to create Soft connection
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吧)
The second step: the export command adds the soft connection to the PATH path
#export PATH="$PATH:/usr/sbin/php"(将上面你准备好的连接加进去就可以了,中间:冒号别漏了,用来做分割的)
Finally: see Next effect
#php -v
The above is the detailed content of How to change php version in linux. For more information, please follow other related articles on the PHP Chinese website!