leolo’s Blog



PHP Shell Script

We can use php as a shell script by adding the line below at the top of the php script file.

#!/usr/local/bin/php -Cq

C means do not change working directory to that of the script.
q means do not send HTTP header.

There is a reference manual “Using PHP from the command line” in php.net


發表迴響

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 變更 )

Twitter picture

You are commenting using your Twitter account. Log Out / 變更 )

Facebook照片

You are commenting using your Facebook account. Log Out / 變更 )

連結到 %s

Follow

Get every new post delivered to your Inbox.