"If a worker wants to do his job well, he must first sharpen his tools." - Confucius, "The Analects of Confucius. Lu Linggong"
Front page > Programming > How to Access the Command Line for XAMPP on Windows?

How to Access the Command Line for XAMPP on Windows?

Published on 2024-11-09
Browse:152

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:\xampp\mysql\bin
  • C:\xampp\php\
  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.

Release Statement This article is reprinted at: 1729224976 If there is any infringement, please contact [email protected] to delete it
Latest tutorial More>

Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.

Copyright© 2022 湘ICP备2022001581号-3