Skip to content

jjsty1e/switch-php-version

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

switch-php-version

一个切换PHP版本的bash脚本

👀 特点

  1. 支持任意目录执行
  2. 全局生效
  3. 友好的提示

👉 安装

switch-php-version.sh 拷贝至任意PATH目录,例如:

mv switch-php-version.sh /usr/local/bin/switch-php-version

# 确保有可执行权限
chmod +x /usr/local/bin/switch-php-version

确保你的PHP的安装路径均为如下格式:/usr/local/opt/[email protected],例如我的:

/usr/local/opt/[email protected]
/usr/local/opt/[email protected]
/usr/local/opt/[email protected]
/usr/local/opt/[email protected]
/usr/local/opt/[email protected]
/usr/local/opt/[email protected]
...

🏃 使用

$ switch-php-version 5.6
$ switch-php-version 7.1
$ switch-php-version 7.4
...

成功时

image

失败时

image

About

一个切换PHP版本的bash脚本

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages