有的时候我们需要临时改变Window系统环境变量,来执行某命令,比如临时指定某PHP版本为环境变量,就可以通过临时改变系统环境变量的方法
PATH=D:\phpstudy_pro\Extensions\php\php7.3.4nts;%PATH%
PATH=E:\phpstudy_pro\Extensions\php\php8.0.2nts;%PATH%
有的时候我们需要临时改变Window系统环境变量,来执行某命令,比如临时指定某PHP版本为环境变量,就可以通过临时改变系统环境变量的方法
PATH=D:\phpstudy_pro\Extensions\php\php7.3.4nts;%PATH%
PATH=E:\phpstudy_pro\Extensions\php\php8.0.2nts;%PATH%
最近宝塔安装了多个PHP版本,导致执行php think命令提示找不到php命令了,于是想到了通过配置环境变量的方法解决export PATH=/www/server/php/73/bin:$PATH 加入到/etc/bash.bashrc或/etc/profile文件中然后执行source /etc/bash.bashrc# 或者source /etc/profile实现重新加载全局的bash配
打开文件vi /etc/profile在打开的文件末尾添加export PATH="YOUR_PATH:$PATH"让配置立即生效source /etc/profile