php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #649 CGI-Detection causes "file not found" errors
Submitted: 1998-08-13 04:29 UTC Modified: 1998-09-19 17:43 UTC
From: panther at prz dot tu-berlin dot de Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 3.0.2a OS: Linux 2.0.x
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.
Password:
Status:
Package:
Bug Type:
Summary:
From: panther at prz dot tu-berlin dot de
New email:
PHP Version: OS:

 

 [1998-08-13 04:29 UTC] panther at prz dot tu-berlin dot de
Following scenario:
I sell digital information and services via Web. There is a perl script doing the payment stuff and executes the apropriate script after successful payment.
My intention was a perl statment
system ("/usr/local/bin/php", "-q", "$targetscript", "$query_string");
because this works well when i write a perl script contain only this single line and execute it in a shell.

From the payment-perl script (invoked by the web server), the php does not accept any commandline parameters, but is neither able to determine the name of the script to execute nor to set the variables from the query string.

I even changed the detection of php running as a cgi (four getenv attempts on typical Web-Environmentvariables in main.c), but this didn't work either.

What can I do?

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-09-19 17:43 UTC] rasmus
This is because PHP knows it is being run in a web environment because it sees all the normal CGI variables.  You can get it to work by setting $QUERY_STRING, $SCRIPT_FILENAME and whatever other environment variables you need.  Or alternatively, unset these variables and pass them in.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 29 03:01:29 2024 UTC