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?
1 Answer
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
2 Comments
Archana Solanki
Tried this but not working. It is getting disconnected.
Joshua Terrill
Then there must be something wrong with your code. Would you care sharing your code?
php /home/user/public_html/script.php arg1 arg2Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.Please take a tour here