How to Access the Command Line for XAMPP on Windows?

Linda Hamilton
Release: 2024-10-18 12:43:31
Original
706 people have browsed it

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;
Copy after login
  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
Copy after login

or

mysql -u root -p
Copy after login

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!

source:php
Statement of this Website
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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!