Home > php > Command line scripting in PHP

Command line scripting in PHP

When talking about command line scripting, most people think of Python or Perl. But it’s good to know that you can do something similar with PHP too!

Example (hello.php):

   # /etc/php5/cli/php.ini
   # The configuration file for the CLI version of PHP.

   print "Hello, World!\n";

You can execute it with “./hello.php” or “php hello.php“.

Notice that the command line version of PHP uses a different php.ini file.

Consult this page to learn more.

Categories: php Tags:
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

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

Twitter picture

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

Facebook photo

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

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: