summaryrefslogtreecommitdiff
path: root/sapi/cli/php.1.in
blob: c5c50e37af3b6c50e34022b89e7af56d98f949b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
./"    +----------------------------------------------------------------------+
./"    | PHP Version 4                                                        |
./"    +----------------------------------------------------------------------+
./"    | Copyright (c) 1997-2003 The PHP Group                                |
./"    +----------------------------------------------------------------------+
./"    | This source file is subject to version 2.02 of the PHP license,      |
./"    | that is bundled with this package in the file LICENSE, and is        |
./"    | available at through the world-wide-web at                           |
./"    | http://www.php.net/license/2_02.txt.                                 |
./"    | 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 immediately.               |
./"    +----------------------------------------------------------------------+
./"    | Author: Marcus Boerger <helly@php.net>                               |
./"    +----------------------------------------------------------------------+
./" 
./" $Id$
./" 
.TH PHP 1 "Feb 2003" "The PHP Group" "Scripting Language"
.SH NAME
.TP 15
.B php
PHP Command Line Interface 'CLI'
.SH SYNOPSIS
.B php
[options] [
.B \-f ]
.IR file
[[\-\-] 
.IR args.\|.\|. ]
.LP
.B php
[options] 
.B \-r 
.IR code
[[\-\-]
.IR args.\|.\|. ]
.LP
.B php
[options] \-\- [
.IR args.\|.\|. ]
.LP
.SH DESCRIPTION
.B 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:
.P
You can parse and execute files by using parameter \-f followed by the name of the 
.IR file 
to be executed.
.LP
Using parameter \-r you can directly execute PHP 
.IR code 
simply as you would do inside a .php file when using the 
.B eval() 
function.
.LP
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.
.SH OPTIONS
.TP 15
.B \-a
Run interactively
.TP
.B \-c \fIpath\fP|\fIfile\fP
Look for 
.B php.ini 
file in the directory
.IR path
or use the specified
.IR file
.TP
.B \-n
No 
.B php.ini 
file will be used
.TP
.B \-d \fIfoo\fP[=\fIbar\fP]
Define INI entry 
.IR foo 
with value
.IR bar
.TP
.B \-e
Generate extended information for debugger/profiler
.TP
.B \-f \fIfile\fP
Parse and execute 
.IR file
.TP
.B \-h
This help
.TP
.B \-i
PHP information and configuration
.TP
.B \-l
Syntax check only (lint)
.TP
.B \-m
Show compiled in modules
.TP
.B \-r \fIcode\fP
Run PHP 
.IR code
without using script tags
.B '<?..?>'
.TP
.B \-s
Display colour syntax highlighted source
.TP
.B \-v
Version number
.TP
.B \-w
Display source with stripped comments and whitespace
.TP
.B \-z \fIfile\fP
Load Zend extension 
.IR file
.TP
.IR args.\|.\|.
Arguments passed to script. Use 
.B '\-\-'
.IR args
when first argument starts with 
.B '\-'
or script is read from stdin
.SH FILES
.TP 15
.B php\-cli.ini
The configuration file for the CLI version of PHP.
.TP
.B php.ini
The standard configuration file will only be used when 
.B php\-cli.ini
cannot not be found.
.SH EXAMPLES
.TP 5
\fIphp -r 'echo "Hello World\\n";'\fP
This command simply writes the text "Hello World" to stabdard out.
.TP
\fIphp \-r 'print_r(gd_info());'\fP
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 executed from your webserver. There are more extensions which
have such a function. For dba use:
.RS
\fIphp \-r 'print_r(dba_handlers(1));'\fP
.RE
.SH TIPS
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:
.P
.PD 0
.RS
#!/bin/php
.P
<?php
.P
 // your script
.P
?>
.RE
.PD 1
.P
.SH SEE ALSO
For a more or less complete description of PHP look here:
.PD 0
.P
.B http://www.php.net/manual/
.PD 1
.P
A nice introduction to PHP by Stig Sæther Bakken can be found here:
.PD 0
.P
.B http://www.zend.com/zend/art/intro.php
.PD 1
.SH BUGS
You can view the list of known bugs or add any new bug you
found here:
.PD 0
.P
.B http://bugs.php.net
.PD 1
.SH AUTHORS
The PHP Group: Thies C. Arntzen, Stig Bakken, Andi Gutmans, Rasmus Lerdorf, Sam Ruby, Sascha Schumann, Zeev Suraski, Jim Winstead, Andrei Zmievski.
.P
Additional work for the CLI sapi was done by Edin Kadribasic and Marcus Boerger.
.P
A List of active developers can be found here:
.PD 0
.P
.B http://www.php.net/credits.php
.PD 1
.P
And last but not least PHP was developed with the help of a huge amount of 
contributors all around the world.
.SH VERSION INFORMATION
This manpage describes \fBphp\fP, version @PHP_VERSION@.
.SH COPYRIGHT
Copyright \(co 1997\-2003 The PHP Group
.LP
This source file is subject to version 2.02 of the PHP license,
that is bundled with this package in the file LICENSE, and is
available at through the world-wide-web at
.PD 0
.P
.B http://www.php.net/license/2_02.txt
.PD 1
.P
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
.B license@php.net 
so we can mail you a copy immediately.