Welcome to Linux Knowledge Base and Tutorial
"The place where you learn linux"

 Create an AccountHome | Submit News | Your Account  

Tutorial Menu
Linux Tutorial Home
Table of Contents

· Introduction to Operating Systems
· Linux Basics
· Working with the System
· Shells and Utilities
· Editing Files
· Basic Administration
· The Operating System
· The X Windowing System
· The Computer Itself
· Networking
· System Monitoring
· Solving Problems
· Security
· Installing and Upgrading
· Linux and Windows

Man Pages
Linux Topics
Test Your Knowledge

Site Menu
Site Map
Copyright Info
Terms of Use
Privacy Info
Masthead / Impressum
Your Account

Private Messages

News Archive
Submit News
User Articles
Web Links


The Web

Who's Online
There are currently, 50 guest(s) and 0 member(s) that are online.

You are an Anonymous user. You can register for free by clicking here




       php [options] [ -f ] file [[--] args...]

       php [options] -r code [[--] args...]

       php [options] -- [ args...]


       PHP  is  a  widely-used general-purpose scripting language
       that is especially suited for Web development and  can  be
       embedded  into  HTML.  This  is the command line interface
       that enables you to the following:

       You can parse and execute files by using parameter -f fol­
       lowed by the name of the file to be executed.

       Using  parameter -r you can directly execute PHP code sim­
       ply as you would do inside a  .php  file  when  using  the
       eval() function.

       If  none  of -r or -f is present but a single parameter is
       given then this parameter is  taken  as  the  filename  to
       parse  and  execute  (same as with -f). If no parameter is
       present then the standard input is read and executed.


       -a             Run interactively

       -c path|file   Look for php.ini file in the directory path
                      or use the specified file

       -n             No php.ini file will be used

       -d foo[=bar]   Define INI entry foo with value bar

       -e             Generate  extended  information  for debug­

       -f file        Parse and execute file

       -h             This help

       -i             PHP information and configuration

       -l             Syntax check only (lint)

       -m             Show compiled in modules

       -r code        Run PHP  code  without  using  script  tags

       php-cli.ini    The configuration file for the CLI  version
                      of PHP.

       php.ini        The  standard  configuration file will only
                      be used  when  php-cli.ini  cannot  not  be


       php -r 'echo "Hello World\n";'
            This  command simply writes the text "Hello World" to
            stabdard out.

       php -r 'print_r(gd_info());'
            This shows the configuration of  your  gd  extension.
            You  can  use this to easily check which imag formats
            you can use. If you have any dynamic modules you  may
            want to use the same ini file that php uses when exe­
            cuted from your webserver. There are more  extensions
            which have such a function. For dba use:
            php -r 'print_r(dba_handlers(1));'


       You  can  use  a  shebang line to automatically invoke php
       from scripts. Only the CLI version of PHP will ignore such
       a first line as shown below:

               // your script


       For a more or less complete description of PHP look here:

       A  nice  introduction  to PHP by Stig Sæther Bakken can be
       found here:


       You can view the list of known bugs or add any new bug you
       found here:


       The  PHP  Group:  Thies C. Arntzen, Stig Bakken, Andi Gut­
       mans, Rasmus Lerdorf,  Sam  Ruby,  Sascha  Schumann,  Zeev
       Suraski, Jim Winstead, Andrei Zmievski.

       Additional work for the CLI sapi was done by Edin Kadriba­
       sic and Marcus Boerger.
       license, that is bundled with this  package  in  the  file
       LICENSE, and is available at through the world-wide-web at

       If you did not receive a copy of the PHP license  and  are
       unable  to  obtain  it  through the world-wide-web, please
       send a note to license@php.net so we can mail you  a  copy

The PHP Group                Feb 2003                      PHP(1)



Security Code
Security Code
Type Security Code

Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.

Help if you can!

Amazon Wish List

Did You Know?
You can get all the latest Site and Linux news by checking out our news page.


Tell a Friend About Us

Bookmark and Share

Web site powered by PHP-Nuke

Is this information useful? At the very least you can help by spreading the word to your favorite newsgroups, mailing lists and forums.
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters. Articles are the property of their respective owners. Unless otherwise stated in the body of the article, article content (C) 1994-2013 by James Mohr. All rights reserved. The stylized page/paper, as well as the terms "The Linux Tutorial", "The Linux Server Tutorial", "The Linux Knowledge Base and Tutorial" and "The place where you learn Linux" are service marks of James Mohr. All rights reserved.
The Linux Knowledge Base and Tutorial may contain links to sites on the Internet, which are owned and operated by third parties. The Linux Tutorial is not responsible for the content of any such third-party site. By viewing/utilizing this web site, you have agreed to our disclaimer, terms of use and privacy policy. Use of automated download software ("harvesters") such as wget, httrack, etc. causes the site to quickly exceed its bandwidth limitation and are therefore expressly prohibited. For more details on this, take a look here

PHP-Nuke Copyright © 2004 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.09 Seconds