Pages

Sunday, 19 July 2015

Environment Variables, PATH in Linux Mint[Easy Way]

Hello friends, My todays post is how to set environment variables(PATH for binaries) in super awesome linux os.

So for this post i will be showing you how to setup php binary in path which comes bundled in xampp.

So, lets do it !!!

1.) First open the terminal and then type the following command !





2.) After entering you will be greeted by the interface of nano text editor which has the code inside the profile file which looks something like this


Actually for setting up the environment variables or path of a binary you must know it's actual path. In my case the path for php binary in /opt/lampp/bin as show in the following picture






So now i need to insert this path in my /etc/profile file ... okay!

so add the following code at the end of your file for adding php binary in path

Now save it by pressing CTRL + O and then CTRL + X to exit the nano text editor now you need to reload the /etc/profile file so for that purpose you can either restart or logout your machine but the most geeky way to do this is add the following lines in terminal like this






Now check to see if php is coming in path add the following line in terminal

php -v

like this








as you can see php is now in my path that's it! Thanks for reading my article!

No comments:

Post a Comment