Friday, June 05, 2009

Running PHP from Command Line (CLI) directly

First, finding the php location, usually in /usr/bin for mac;
Then use execute: /usr/bin/php -r 'echo phpinfo();'

DONT forget put quote surround your script.
For more info, type 'man php'

UPDATE:
ANOTHER EASY WAY, JUST TYPE: 'php -a'

No comments: