php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #806 Running php via CGI with command-line arguments
Submitted: 1998-10-01 11:58 UTC Modified: 2000-05-04 16:07 UTC
From: Florian dot Xhumari at inria dot fr Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 3.0.4 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: Florian dot Xhumari at inria dot fr
New email:
PHP Version: OS:

 

 [1998-10-01 11:58 UTC] Florian dot Xhumari at inria dot fr
I have set up a CGI script (written in sh) which calls /usr/local/bin/php, and I want to give php some command-line arguments (like for setting the ini file path). Note that the arguments passed to the CGI script do not get passed to php, so there is no security problem.

Currently php does not process command-line arguments if invoked as/by/through a CGI script.

A simple patch that I did:
In main.c, when checking:
    if (!cgi) .... 
for processing arguments, replace with:
    if (!cgi || getenv("PHP_PROCESS_ARGS")) ...
In this way, I can set the PHP_PROCESS_ARGS environment variable in my script that calls php, and then call php with the right arguments.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-05-04 16:07 UTC] sterling at cvs dot php dot net
This is currently supported.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 06:01:29 2024 UTC