how to access the command line for xampp on windows

后端 未结 9 1241
难免孤独
难免孤独 2020-11-28 07:22

I am running Xampp on my Windows 7 machine and was wondering if and how I could run commands for xampp via a command line. commands like php phpfile.php

Any advice w

9条回答
  •  生来不讨喜
    2020-11-28 08:00

    Thank you guys for this answers. But I think the accepted answer needs more clarity, As i found difficulty in getting the solution.

    1. We may set the environment variable as mentioned in the answer by w0rldart .

      In this case(after seting envmnt var) we may run the phpFile by opening start >> CMD and typing commands like,

      php.exe

      or

      php

      example:

      php.exe C:\xampp\htdocs\test.php
      
    2. you can open Start >> CMD as administrator and write like

      example:

      C:\xampp\php\php.exe C:\xampp\htdocs\test.php
      

      or

      C:\xampp\php\php C:\xampp\htdocs\test.php
      

    Hopes this will help somebody.

提交回复
热议问题