Home  >  Article  >  Database  >  How Do I Access the XAMPP Command Line on Windows?

How Do I Access the XAMPP Command Line on Windows?

Barbara Streisand
Barbara StreisandOriginal
2024-11-19 17:10:03331browse

How Do I Access the XAMPP Command Line on Windows?

How to Access the Command Line for XAMPP on Windows

Windows users who have installed XAMPP often encounter a question: how do I access the command line for XAMPP? This enables the execution of commands like "php phpfile.php" directly from the command prompt.

Solution:

XAMPP does not provide an inbuilt command line interface. Instead, you need to configure your Windows environment variables to include the paths to both PHP and MySQL.

Instructions:

  1. Right-click "Computer" (or "This PC") and select "Properties."
  2. In the left pane, click "Advanced system settings."
  3. Under "Environment Variables," locate the "Path" variable in the "System variables" section and click "Edit."
  4. Add the following paths to the end of the variable value, separated by semicolons (;):

    • C:xamppmysqlbin
    • C:xamppphp
  5. Click "OK" to save the changes.

Testing:

After completing the above steps, you can test if the command line access is working by opening a Command Prompt (cmd.exe) and executing the following commands:

php
mysql

You should see the PHP and MySQL command line interfaces, respectively. This indicates that you can now execute PHP and MySQL commands directly from the command line.

The above is the detailed content of How Do I Access the XAMPP Command Line 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