-1

i want to run a script PHP (example : http://localhost/project/test.php) from the command line without opening any browser. i use the command :

START  http://localhost/projetc/test.php

but this command opens a browser

do you have any solutions?

userHassan
  • 23
  • 1
  • 6

2 Answers2

2

Find the path for your php.exe, and run it like this (make sure your run CMD.exe as an administrator):

C:\PHP5\php.exe -f "C:\PHP Scripts\script.php"

Refer to manual: http://php.net/manual/en/install.windows.commandline.php

cederlof
  • 7,206
  • 4
  • 45
  • 62
1

path/to/php.exe path/to/script.php

Example if you're using xampp:

C:\xampp\php\php.exe C:\scripts\script.php

Dinistro
  • 5,701
  • 1
  • 30
  • 38