On this issue, but also I met the future, consult others just know.
There are two ways to set environment variables in Linux (as I know), one is temporary, there is no environment variable after exiting, and the other is the permanent environment variable, which is what I want to say.
Well, not much to say, on the code.
To test whether to add a PHP environment variable method:
As follows: input php-v show PHP command not found
[Email protected] ~]# Php-v-bash:php:command not found
1. First go to Linux to find the integration environment of the PHP file location
[[Email protected]/]# CD Phpstudy/server/php/[[email protected] php]# lsbin do_not_delete etc include lib php sbin var[[email protected] php]# CD Bin/[[email protected] bin]# Lsphar Phar.phar PHP php-cgi php-config phpize[[email protected] bin]# Pwd/phpstudy/server/php/bin
As above get to PHP bin directory location, I Linux with Phpstudy integrated environment
Then you need to go to the Linux system environment variable file to set the PHP environment variable, and similar in Windows. Files in the root directory/etc
[Email protected] ~]# CD/[[email protected]/]# vim Etc/profile
Then you start editing the environment variable's configuration file
The path to the bin directory of the found PHP is placed here to add these two lines of code;
To add additional environment variables simply locate the directory where the executable file is located, append a colon (":") to the directory, and then save and exit
Execute UPDATE environment variable command:
[Email protected]/]# Source/etc/profile
And then enter the php-v to be OK.
[Email protected]/]# php-vphp 5.4.26 (CLI) (built:sep 7 12:52:40) Copyright (c) 1997-2014 the PHP groupzend E Ngine v2.4.0, Copyright (c) 1998-2014 Zend Technologies with Zend Guard Loader v3.3, Copyright (c) 1998-2013, by Zend Technologies
PS: The above is purely personal opinion, I hope you support more!
Setting PHP persistent environment variables in Linux environment Phpstudy integration Environment