环境变量永久生效方法:
Linux下,如PhpStorm内置终端cd ~;vi .bashrc
不行就cd ~;vi .bash_profile
通过vi编辑输入例如如下代码:export PATH="一堆路径"
临时加入想要添加的环境变量:export aaa=bbb
保存成功后,重新进入终端生效
附本机环境变量配置(使用指定PHP版本及指定laravel的phpunit)export PATH="/mingw64/bin:/usr/bin:/c/Users/xiaolong.zhou/bin:/d/Program Files/VStart:/d/Program Files/Ruby24-x64/bin:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/d/Program Files/TortoiseSVN/bin:/d/Visual-NMP-x64/Bin/PHP/php-7.1.17-nts-x64:/c/ProgramData/ComposerSetup/bin:/d/Program Files/nodejs:/d/Program Files/TortoiseGit/bin:/d/Program Files/Ruby24-x64/bin:/c/Users/xiaolong.zhou/AppData/Roaming/Composer/vendor/bin:/c/Users/xiaolong.zhou/AppData/Roaming/npm:/c/Users/xiaolong.zhou/AppData/Roaming/npm/gulp:/d/Visual-NMP-x86/www/laravel/laravel/vendor/bin"