PHP Problems

Gary Mort gmcups at saplings.us
Mon Nov 13 15:24:42 PST 2006


I'm trying to enable the CUPS server to run PHP scripts.
Platform: Fedora Core 6 Linux
CUPS version 1.2.5

I followed the instructions here: http://www.cups.org/documentation.php/cgi.html
and created a cgi.types file with the line 'application/x-httpd-php php'

I restarted the server.

I created a simple php program as follows:

'#!/usr/bin/php-cgi
<html> <head> <title>PHP Test</title> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> </head>
<body> <h1>PHP Test</h1> <p> <b>An Example of PHP in Action</b><br /> <?php echo "The Current Date and Time is: <br>"; echo date("g:i A l, F j Y.");?> </p>
</p> </body> </html>'

I've tried it with and without the first line, with the first line as #!/usr/bin/php as well as php-cgi

I placed the file in the root doc directory.  I set the permissions on the file to 777 to make sure there is no permissions problem.

It seems that CUPS is trying to invoke PHP when the file is accessed, but than it hangs and I get no data back from the server.  The error log contains the following message:
D [13/Nov/2006:18:08:31 -0500] CGI /usr/bin/php started - PID = 5223
I [13/Nov/2006:18:08:31 -0500] Started "/usr/bin/php" (pid=5223)

Running the program manually from the command line(ie /usr/bin/php /usr/share/cups/doc/hello.php) results in the correct output being displayed on the screen.

So, any ideas what I'm doing wrong?






More information about the cups mailing list