summaryrefslogtreecommitdiff
path: root/sapi/cli/php.1
blob: cc9a3adcdfd617574ca7b73763c68278ac20e6d2 (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
./"    +----------------------------------------------------------------------+
./"    | 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
.SH NAME
.B 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] [-B 
.IR code
] 
.B -R 
.IR code
[-E 
.IR code
] [[--]
.IR args
]
.LP
.B php
[options] [-B 
.IR code
]
.B -F 
.IR file
[-E 
.IR code
] [[--]
.IR args
]
.LP
.B php
[options] -- [
.IR args
]
.LP
.SH DESCRIPTION
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
.B PHP 
.IR code 
simply as you would do inside a 
.B php 
file when using the 
.B eval() 
function.
.LP
It is also possible to process the standard input line by line using either
the parameter -R or -F. In this mode each separate input line causes the
.IR code 
specified by -R or the 
.IR file
specified by -F to be executed.
You can access the input line by \fB$argn\fP. While processing the input lines
.B $argi 
contains the number of the actual line being processed. Further more
the paramters -B and -E can be used to execute 
.IR code
(see -r) before and
after input line processing respectively.
.LP
If none of -r -f -B -R -F or -E is present but a single parameter is
given then this is taken as the filename to process (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 path|file 
Look for 
.B php.ini 
file in this directory
.TP
.B -n
No 
.B php.ini 
file will be used
.TP
.B -d foo[=bar]
Define INI entry 
.IR foo 
with value
.IR bar
.TP
.B -e
Generate extended information for debugger/profiler
.TP
.B -f file
Parse and execute 
.IR file
.TP
.B -h
This help
.TP
.B -i
.B PHP
information
.TP
.B -l
Syntax check only (lint)
.TP
.B -m
Show compiled in modules
.TP
.B -r code
Run 
.B PHP 
.IR code
without using script tags
.B '<?..?>'
.TP
.B -B code
Run 
.B PHP 
.IR code
before processing input lines
.TP
.B -R code
Run 
.B PHP 
.IR code
for every input line
.TP
.B -F file
Parse and execute 
.IR file
for every input line
.TP
.B -E code
Run 
.B PHP 
.IR code
after processing all input lines
.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 file
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 
.B PHP.
.TP
.B php.ini
The standard configuration file will only be used when 
.B php-cli.ini
cannot not be found.
.SH COPYRIGHT
Copyright (c) 1997-2003 The PHP Group
.LP
This source file is subject to version 2.02 of the 
.B 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.
.P
.PD 1
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.