Bug 247796 - php and perl scripts do not run under CUPS
php and perl scripts do not run under CUPS
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: cups (Show other bugs)
6
All Linux
low Severity low
: ---
: ---
Assigned To: Tim Waugh
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-07-11 10:25 EDT by Opher Shachar
Modified: 2007-11-30 17:12 EST (History)
0 users

See Also:
Fixed In Version: 1.2.11-1.fc6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-07-11 12:48:27 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
php and cgi scripts and logs (2.33 KB, application/x-gzip)
2007-07-11 10:25 EDT, Opher Shachar
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
CUPS Bugs and Features 2440 None None None Never

  None (edit)
Description Opher Shachar 2007-07-11 10:25:22 EDT
Description of problem:
I followed the instructions to allow cgi, php and perl scripts to run under CUPS.
Unfortunately, only the cgi script runs correctly.
When the client accesses the php or perl scripts it hangs and the log shows the
executable (/usr/bin/php, /usr/bin/perl) ran without a script file - hence doing
nothing - and exited OK.

Version-Release number of selected component (if applicable):
1.2.10-7.fc6

How reproducible:
Always

Steps to Reproduce:
1. Update /etc/cups/cgi.types to be:
application/x-httpd-cgi cgi
application/x-httpd-php php
application/x-httpd-perl pl

2. Execute: service cups restart
3. Copy test1.php and test2.cgi to /usr/share/cups/doc/ .
4. Do: chmod +x test2.cgi
5. Navigate to: http://localhost:631/test2.cgi
   All OK.
6. Navigate to: http://localhost:631/test1.php
   Client (firefox) hangs... bad :(
  
Actual results:
In the error_log for the php script you'll notice that ther is no argv[1].
Hence the executable's - /usr/bin/php - input is it's empty stdin.
You'll also notice that is_cgi() returns a correct 'options' field, and what's
needed is to set argv[1] to it.

There's also an unrelated second problem: PATH_INFO is set to the 'options'
field returned which is *so* wrong; see http://www.ietf.org/rfc/rfc3875 .

Expected results:


Additional info:
Attached are the php and cgi scripts and corresponding error_log outputs.
Comment 1 Opher Shachar 2007-07-11 10:25:22 EDT
Created attachment 158955 [details]
php and cgi scripts and logs
Comment 2 Tim Waugh 2007-07-11 12:39:39 EDT
Reported upstream.
Comment 3 Tim Waugh 2007-07-11 12:48:27 EDT
Please update to the latest cups packages (yum update 'cups*').

Note You need to log in before you can comment on or make changes to this bug.