Run php , mysql commands from command-line after installing XAMPP (Linux)

Once you have installed XAMPP, You have your system ready necessary development programs like PHP, MySQL etc. But you cannot yet run those commands from you command line, Because your terminal does not recognise those yet. You can either install the programs independently as a package or you can set path of XAMPP binaries into linux environment variable so that your terminal will be able to execute those binaries. Here is how you can do that. Open file /etc/environment you will find a PATH variable in this file, PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games" You can append the path of XAMPP binaries (i.e. /opt/lampp/bin) in this variable. PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/lampp/bin" After doing this, do a source /etc/environment Run a test command php -v , to see if the changes worked !!

Site Footer