Home >Backend Development >PHP Tutorial >How to Access the XAMPP Command Line on Windows?
Accessing the Command Line for XAMPP on Windows
XAMPP is a popular software suite that provides a convenient way to install and configure Apache, MySQL, PHP, and other related tools on Windows systems. However, by default, XAMPP does not include a command line console for executing commands directly.
Adding XAMPP to Windows PATH Variables
To access the XAMPP command line, you need to add the following two directories to your Windows PATH environment variables:
This will allow you to execute PHP and MySQL commands directly from the command prompt (CMD).
Using the XAMPP Command Line
Once you have updated your PATH variables, you can open a CMD window and execute PHP and MySQL commands as follows:
Note: You will need to replace username, password, and database_name with the appropriate values.
Example
To start a PHP application using the XAMPP command line, you would open a CMD window and execute the following command:
php C:\xampp\htdocs\my_project\index.php
This would run the PHP script located at C:xampphtdocsmy_projectindex.php.
Troubleshooting
If you encounter any issues while trying to access the XAMPP command line, ensure that you have added the correct directories to your PATH variables and that you have the necessary permissions to execute the desired commands.
The above is the detailed content of How to Access the XAMPP Command Line on Windows?. For more information, please follow other related articles on the PHP Chinese website!