How to add php and mysql commands to environment variables in linux CentOS

Source: Internet
Author: User
Tags mysql commands

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.