Archana Solanki
Archana Solanki

Reputation: 23

How to run php file through command line?

I am learning creating Websockets in PHP. I have code for client side and for server side file as well. I want to learnt how to run php files through command line. Can anyone please provide me step by step solution for the same?

Upvotes: 2

Views: 1089

Answers (1)

Joshua Terrill
Joshua Terrill

Reputation: 2017

If you're on Windows, make sure you have PHP installed and type this into a command prompt:

C:\Path\To\php.exe C:\Path\To\Your\script.php

(source: http://www.php.net/manual/en/install.windows.commandline.php)

And on Linux/Unix: php /path/to/script.php

Upvotes: 2

Related Questions