"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 Do I Access the XAMPP Command Line on Windows?

How Do I Access the XAMPP Command Line on Windows?

Published on 2024-12-22
Browse:481

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

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