Environment Variables (Windows)
For using console commands for PHP ans MySQL in a comfortable way, some settings in the environment variables should be done. This document describes how to do this.
You need to know in which paths of your Windows installation the following files are located:
This document uses these paths as an example:
- C:\Program Files (x86)\PHP\php-5.6.30\php.exe
- C:\Program Files\MariaDB 10.1\bin\mysql.exe
Entering environmental variables
- Press the key combination "Windows+R" to start the input request
- Start the program "SystemPropertiesAdvanced.exe"
- Click at "Environment Variables"
- Open the variable "Path" at "System variables" with a double click
- With Windows 2012: In the line "Value of Variables", add the paths to php.exe and mysql.exe, separated by semicolon, directly at the beginning of the line. Regarding the path example, this would be "C:\Program Files (x86)\PHP\php-5.6.30\;C:\Program Files\MariaDB 10.1\bin\;"
- Windows 2016 and above: Add two new entries with their respective pathnames
- Close all windows by clicking "OK"
- Restart the command line
Now you should be able to call up the commands "php" and "mysql" without problems in the command line.