How to change php version number in linux

醉折花枝作酒筹
Release: 2023-03-09 10:14:01
Original
2547 people have browsed it

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.

How to change php version number in linux

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
Copy after login

How to change php version number in linux

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吧)
Copy after login

3. The export command will add the soft connection to the PATH path

#export PATH="$PATH:/usr/sbin/php"
Copy after login

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
Copy after login

How to change php version number in linux

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!

Related labels:
php
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!