|  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
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.


Add a Patch

Pull Requests

Add a Pull Request


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: Sat Apr 20 23:01:28 2024 UTC