|  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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
17 + 17 = ?
Subscribe to this entry?

 [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