You are here: Re: Script running under Command Prompt or Browser or some other application? « All PHP « IT news, forums, messages
Re: Script running under Command Prompt or Browser or some other application?

Posted by AnrDaemon on 12/08/07 03:29

Greetings, Jerry Stuckle.
In reply to Your message dated Saturday, December 8, 2007, 05:36:28,

>>>> In reply to Your message dated Wednesday, December 5, 2007, 14:56:22,
>>>>
>>>>> As he said - if it is from the command line, $argc and $argv will exist,
>>>>> as will $_SERVER['argc'] and $_SERVER['argv'].
>>>> Not if it is started using PHP-CGI and argc/argv vars disabled in
>>>> configuration.
>>
>>> If it's using php-cgi, then it's not started from the command line, is it?
>>
>> You forgot that PHP-CGI *IS* a commandline executable intended to deal with
>> pipelined I/O from/to server.
>> And You still can use it instead of CLI (either knowing that or by accident).
>>

> No, I didn't. CGI is NOT the same as CLI. CGI is started from a web
> server. CLI is started from a command line. The processing and options
> are not the same - which is partly why they have different names!

Go ahead and study basics, please.

Your statement "they are different because they are intended to use in
different way" is silly.

While a hammer and an axe is not the same, what makes the difference if I use
them both to hammer the nails in the wall with exactly equal success?

Remember: rock was not intended to be weapon, but Abel was killed by the Kain
throwed it.

>> JFYI:
>> <stdout>:php-cgi.exe --help
>> Usage: php [-q] [-h] [-s] [-v] [-i] [-f <file>]
>> php <file> [args...]
>>
>> [snip]
>>
>>
>> <stdout>:php.exe --help
>> Usage: php [options] [-f] <file> [--] [args...]
>> php [options] -r <code> [--] [args...]
>> php [options] [-B <begin_code>] -R <code> [-E <end_code>] [--] [args...]
>> php [options] [-B <begin_code>] -F <file> [-E <end_code>] [--] [args...]
>> php [options] -- [args...]
>> php [options] -a
>>
>> [snip]
>>
>>
>> Not a big difference, You see. Basically no difference in general,
>> same [-f <filename>] syntax for both versions of interpreter.
>>
>>

> Ah, but there are differences. And much more than your little --help
> commands show. All they have is the command line options.

Show me any:

silly.php:
<?php

echo "General rant with personal attack\n";

?>

[C:\usr\sbin\php-5.2]$php.exe -f silly.php
General rant with personal attack

[C:\usr\sbin\php-5.2]$php-cgi.exe -f silly.php
General rant with personal attack

[C:\usr\sbin\php-5.2]$

Difference between CLI and CGI versions of executable is described in the
manual: CLI have forced to have argc/argv variables set and some other
things. NO OTHER difference than described in the manual.


--
Sincerely Yours, AnrDaemon <anrdaemon@freemail.ru>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация