php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #30056 Merge CLI and CGI functionality
Submitted: 2004-09-10 21:26 UTC Modified: 2004-09-11 01:51 UTC
From: techtonik at tut dot by Assigned:
Status: Wont fix Package: Feature/Change Request
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2004-09-10 21:26 UTC] techtonik at tut dot by
Description:
------------
I know that it is strange request and for developers it is more difficult to support two different functionalities in one binary, but..

For a long run PHP had this two .exe messing around and often it was quite easy to mention CLI instead of CGI and vice versa. With PHP5 CLI version becomes default and CGI migrated into directory. In PHP4 in directory was CLI version. Although it is quite easy to remember, it is rather hard to explain users what is CGI or CLI, why their php.exe is incorrect and where to find another php.exe. Often they just replace CGI with CLI (with "correct" version, ehh)  and after upgrade to the story begins anew.

I know that this is not so easy, but if there were a voting systems for proposals I bet this one would be in the first 20. I propose to leave default behavior as CGI and use "-f" key to execute script in CLI mode. Of course, it is more convenient to leave default mode to CLI, but it can probably  lead to incompatibilities with CGI specification.

Reproduce code:
---------------
CGI behavior
php.exe file.php

CLI
php.exe -f file.php



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-09-10 23:21 UTC] helly@php.net
You are at least one year to late. Now such a change would introduce a major BC problem for both versions. Also it is not so easily to merge them because they are in fact very different. Just read the docs and be done. If some users don't read it and get a problem, well than it is their problem.
 [2004-09-11 00:04 UTC] techtonik at tut dot by
Sure it will introduce some problems, but only with PHP and support scripts installation and only with one of the CGI and CLI stepbrothers. 

This is major change and it, of course, should be indicated at the top of install.txt. 

Those, who are running CGI version won't feel any changes in PHP's behavior. Only CLI users will need to change their PHP detection routines by adding "-f" or "--cli" key to execute the scipt.  

There also can be some environment checks to detect CGI or CLI mode of PHP executable along with explicit keys. At least you can make it phpi.exe or phpex.exe.

If they are so different, you can glue the binaries and include stub, which will parse cmdline or cgi environment variables and pass control to appropriate part. This is a bad solution, since CLI version is very limited under windows (it doesn't understand ordinary quotes, for example), but it will be possible to release such thing at least in next year.
 [2004-09-11 01:51 UTC] helly@php.net
"At least you can make it phpi.exe or phpex.exe."

That's not differnt from having two versions. (dot)

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 06 12:01:31 2024 UTC