BlackWhite
BlackWhite

Reputation: 832

How to run php script from CLI?

I have the method stored in Z:\work\project\apps\controllers\_cron\tools\method

How can I call "method" using the command line?

Upvotes: 3

Views: 1269

Answers (2)

Jamie Taylor
Jamie Taylor

Reputation: 4765

Easy as

C:\path\to\php.exe -f "Z:\path\to\file.php"

Source: #1 result for "run php from command line windows" in google

Upvotes: 1

Madara's Ghost
Madara's Ghost

Reputation: 174957

You run the PHP executable with the location of the file as an argument (Windows example: php.exe path/to/method.php). The location of php.exe depends on where you installed it.

Read more.

Upvotes: 1

Related Questions