Red Hat Bugzilla – Bug 247796
php and perl scripts do not run under CUPS
Last modified: 2007-11-30 17:12:10 EST
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):
Steps to Reproduce:
1. Update /etc/cups/cgi.types to be:
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
6. Navigate to: http://localhost:631/test1.php
Client (firefox) hangs... bad :(
In the error_log for the php script you'll notice that ther is no argv.
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 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 .
Attached are the php and cgi scripts and corresponding error_log outputs.
Created attachment 158955 [details]
php and cgi scripts and logs
Please update to the latest cups packages (yum update 'cups*').