By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,890 Members | 1,050 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,890 IT Pros & Developers. It's quick & easy.

Command-line interface

P: n/a
Hi. In the docs, it says the command-line executable (that allows you to
run PHP scripts on your console as opposed to inside the web server) was
introduced in 4.3.0. But I was told by someone that he can do command-line
stuff with 4.1.0.

Is anyone else using the command-line executable with a version earlier than
4.3.0?

Thanks!
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Ever Olano wrote:
In*the*docs,*it*says*the*command-line*executable*(that*allows*you*to
run PHP scripts on your console as opposed to inside the web server) was
introduced in 4.3.0.**But*I*was*told*by*someone*that*he*can*do
command-line stuff with 4.1.0.

Is anyone else using the command-line executable with a version earlier
than 4.3.0?


You can use the CGI binary from the command line. To compile the CGI version
you leave out the --with-apxs configure flag.

--
Chris Hope
The Electric Toolbox - http://www.electrictoolbox.com/
Jul 17 '05 #2

P: n/a
>Hi. In the docs, it says the command-line executable (that allows you to
run PHP scripts on your console as opposed to inside the web server) was
introduced in 4.3.0. But I was told by someone that he can do command-line
stuff with 4.1.0.

Is anyone else using the command-line executable with a version earlier than
4.3.0?


There are 3 ways to use PHP: web browser module, CGI, and standalone
executable. Web applications generally prefer the web browser
module approach if they can use it (does it work with browsers other
than Apache?)

The manual for PHP 2.0/FI, available on www.php.net if you look for
it hard enough ( at http://www.php.net/manual/phpfi2.php#commandline
), has documentation on how to use the CGI executable as a command-line
PHP interpreter. I believe the command-line feature has been around
a long time, although it looks a lot like shoe-horning the CGI
module into another use. I'm not sure this version allowed passing
command-line arguments that you could get at, though. That seems
to have been introduced around 4.2.0, along with other features for
the command line like not producing HTTP headers by default.

I've used it in the past, including before the existence of
superglobals, which were introduced in 4.1.0 (I think). It's great
to make backend scripts for maintaining a database that is mostly
manipulated by PHP web pages anyway, but this part isn't activated
by a web page (e.g. periodically expiring old entries, taking stuff
entered by web page and actually DOING something with it after it
goes into the database, etc.) I've since upgraded to a later version,
but it existed and worked.

Gordon L. Burditt
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.