Home  >  Article  >  Backend Development  >  How to Access the Command Line for XAMPP on Windows?

How to Access the Command Line for XAMPP on Windows?

Linda Hamilton
Linda HamiltonOriginal
2024-10-18 12:43:31717browse

How to Access the Command Line for XAMPP on Windows?

Accessing the Command Line for XAMPP on Windows

XAMPP, the popular web development package, provides an integrated development environment on Windows. It includes essential components such as Apache, MySQL, and PHP. However, unlike Linux-based systems, XAMPP on Windows does not natively offer a command-line interface for executing commands for these components.

Solution: Modifying Environment Variables

To access the command line for XAMPP on Windows, you need to add the following paths to your PATH environment variables:

  • C:xamppmysqlbin
  • C:xamppphp
  1. Open the Control Panel and navigate to System and Security > System.
  2. Click "Advanced system settings."
  3. Under the "Advanced" tab, click "Environment Variables."
  4. Under "User variables for [your username]," find the PATH variable and double-click it.
  5. Add the following paths to the end of the existing value, separated by semicolons:
;C:\xampp\mysql\bin;C:\xampp\php;
  1. Click "OK" to save the changes.

Using the Command Line

Once you have added the paths to your environment variables, you can open a command prompt (CMD) and execute PHP and MySQL commands. For example:

php phpfile.php

or

mysql -u root -p

Note: You may need to restart your computer for the changes to take effect.

The above is the detailed content of How to Access the Command Line for XAMPP on Windows?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn