Bug 247796 - php and perl scripts do not run under CUPS
Summary: php and perl scripts do not run under CUPS
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: cups
Version: 6
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-07-11 14:25 UTC by Opher Shachar
Modified: 2007-11-30 22:12 UTC (History)
0 users

Fixed In Version: 1.2.11-1.fc6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-07-11 16:48:27 UTC
Type: ---
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
CUPS Bugs and Features 2440 0 None None None Never

Description Opher Shachar 2007-07-11 14:25:22 UTC
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 14:25:22 UTC
Created attachment 158955 [details]
php and cgi scripts and logs

Comment 2 Tim Waugh 2007-07-11 16:39:39 UTC
Reported upstream.

Comment 3 Tim Waugh 2007-07-11 16:48:27 UTC
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.