3

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

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

2
  • If you mean method literally as in method of a class, you will need a script that calls this method and then run this script from CLI. Commented Feb 27, 2013 at 13:58
  • @fab: One could do -r "include(...); my_method();" or similar. Commented Sep 6, 2013 at 12:07

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

I use the methot presentated here ellislab.com/codeigniter/user-guide/general/cli.html, but the response is index page in html(main page). $ php index.php tools method
1

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.