IMP with PHP as CGI
| From: | Blaz Zupan | Date: | Tue, 03 Jul 2001 08:29:57 +0000 |
| Subject: | IMP with PHP as CGI | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-55953@lists.php.net to get a copy of this message | ||
Until a couple of days ago, we were running IMP on our server with PHP
compiled as an Apache module. Because we wanted to use the apache SuEXEC
wrapper, I compiled PHP as a CGI, which works mostly fine. Every user on our
web needs to put the following wrapper in their cgi-bin directory to be able
to use PHP:
#!/bin/sh
export SCRIPT_NAME=$REDIRECT_URL
export SCRIPT_FILENAME=$PATH_TRANSLATED
exec /usr/local/bin/php
But now we have a problem with IMP and mail attachments. When you view a mail
message with attachments in IMP, it gives you an icon with a link to the
attachment, which you should be able to click on to get the contents of the
attachment. The URL pointed to is something like:
http://server/horde/imp/view.php3/attached-file.bin?mailbox=INBOX&index=171&bodypart=2&actionID=13
This works fine when PHP is compiled as a module (view.php3 is read by the PHP
module and attached-file.bin is sent to your browser), but when running as a
CGI, PHP tries to open the file view.php3/attached-file.bin, which of course
does not exist and it fails with error code 255 and not displaying anything
(which I think is a bug in itself, it took me a couple of hours to figure out
at all what is going on).
Any idea how I could fix that?