Running PHP in commandline

Running some short scripts of PHP in commandline [1] is quite easy, once you got the trick.

C:\\>cli
<?php echo md5(\”whatever\”); ?> [Enter]
^Z [F6][Enter]
008c5926ca861023c1d2a36653fd88e2

or you can do:

C:\\>cli -a
<?php echo md5(\”whatever\”); ?> [Enter]
008c5926ca861023c1d2a36653fd88e2

cli is a shorcut to c:\\php\\cli\\php.exe.

[1] http://ch.php.net/manual/en/features.commandline.php

Leave a Reply