In linux CentOS, how does one add php and mysql commands to environment variables? After installing php and MySQL on Linux CentOS, 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 (assuming that php and mysql are installed in/usr/local/webserver/php/and/usr/local respectively) /webserver/mysql ). Method 1: run the command export PATH = $ PATH:/usr/local/webserver/php/bin and export PATH = $ PATH: /usr/local/webserver/mysql/bin using this method will only be 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: This method takes effect only for the current Login User. Method 3: Modify the/etc/profile file to make it permanently effective for all system users, add the following two lines of code PATH = $ PATH:/usr/local/webserver/php/bin:/usr/local/webserver/mysql/binexport PATH at the end of the file: run the source/etc/profile command or run the dot command. /profile to make the modification take effect. You can run the echo $ PATH command to check whether the modification is successfully added.