In CentOS, how does one add PHP and mysql commands to environment variables? after installing php and MySQL on LinuxCentOS, you need to add the php and mysql commands to the system commands for ease of use, if you run the & ldquo; php-v & rdquo; command to view the current php version information before the environment variable is added, an error indicating that the command does not exist will be prompted, next we will introduce in detail how to add php and mysql to the environment in linux.
In CentOS, how to add PHP and mysql commands to environment variables and install php and MySQL on CentOS Linux, you need to add the php and mysql commands to the system command. if you do not add the php and mysql commands to the environment variables, run the "php-v" command to view the current php version information, A message indicating that the command does not exist is displayed, next we will introduce in detail how to add php and mysql to environment variables in linux (false php and mysql are installed in/usr/local/webserver/php/and/usr/respectively/ local/webserver/mysql ).
Method 1: run the command export PATH = $ PATH:/usr/local/webserver/php/bin and export PATH = $ PATH:/usr/local/webserver/mysql/bin.
This method is only valid for the current session. that is to say, the PATH setting will expire after the system is logged out or logged out, but will only take effect temporarily.
Method 2: execute vi ~ /. Modify the PATH line in the bash_profile file and add/usr/local/webserver/php/bin and/usr/local/webserver/mysql/bin to PATH = $ PATH: $ HOME/bin after a row
This method takes effect only for the current login user
Method 3: modify the/etc/profile file to make it permanently effective and take effect for all system users. add the following two lines of code at the end of the file:
PATH=$PATH:/usr/local/webserver/php/bin:/usr/local/webserver/mysql/binexport PATH
Finally, run the source/etc/profile command or run the./profile command to make the modification take effect. after the command is executed, run the echo $ PATH command to check whether the modification is successfully added.