Home  >  Article  >  Backend Development  >  How to change php version in linux

How to change php version in linux

藏色散人
藏色散人Original
2020-08-17 09:21:094777browse

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.

How to change php version in linux

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

How to change php version in linux

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

How to change php version in linux

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn