smith
smith

Reputation: 5461

How can I run php on the command line?

I have a php class file, and I want to find out how I can run it on the Windows command line. Do I need to install something? Are there any tutorials? Any help will be greatly appreciated!

Upvotes: 1

Views: 3709

Answers (4)

Daniel
Daniel

Reputation: 157

Open up the Command Line switch to the folder where your php class is located. then type the path to your php.exe and give the class file as parameter. Try googling for "Add PHP to Path" to get some information how to do this with like 'php file.class.php'

Hope this helps.

Upvotes: 0

James L.
James L.

Reputation: 4097

Install xampp and then read this:

http://www.blog.highub.com/php/running-php-using-windows-command-line-with-xampp/

Upvotes: -1

ultra
ultra

Reputation: 141

This may helps you: Install windows commandline

Upvotes: 1

Mob
Mob

Reputation: 11106

Assuming you have PHP already installed for windows use this to run a file:

php.exe -f myfile.php

More detail here: http://php.net/manual/en/install.windows.commandline.php

Upvotes: 4

Related Questions