server error when using ForceType

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
davem
Forum Newbie
Posts: 2
Joined: Tue Jan 06, 2004 3:39 pm
Location: MI

server error when using ForceType

Post by davem »

Hello,
I'm stumped on this one and would appreciate any and all help.

I'm trying to implement some scripts that make a forum spiderable, but the mod_mime "ForceType" is not working properly. I have determined that it is installed and working by testing it with a gif file called eek.gif. If I rename eek.gif to eek and add this to .htaccess :

Code: Select all

<Files eek>
ForceType image/gif
</Files>
a browser will display the gif file properly. Without the entry in .htaccess, the browser displays the guts of the gif file. This tells me that mod_mime and ForceType work.

When I try to use it for a php script, it gives me a "Premature end of script headers" in the apache error_log file. Here is what I've done so far to debug with a simple script:

Create php file called phpinfo.php with contents:

Code: Select all

<?php
       phpinfo();
?>
Verified that it works properly with a browser. Copied to phpinfo without the ".php" extension. Browser now shows contents of the php file. Add this to the .htaccess file:

Code: Select all

&lt;Files phpinfo&gt;
ForceType application/x-httpd-php
&lt;/Files&gt;
Now the browser shows the "Internal Server Error" page and the apache error_log shows the "Premature end of script headers" error.

Here is my server info, and I have root on it if anybody has anything for me to try. Thanks in advance. :)
Dave

PHP Version 4.3.3

System Linux mydomain.com 2.2.19-6.2.1ensim.smp-3.1.5-2 #1 SMP Fri Jan 17 02:15:45 PST 2003 i686
Build Date Nov 10 2003 22:12:29
Configure Command './configure' '--prefix=/usr' '--with-xml' '--enable-bcmath' '--enable-calendar' '--enable-ftp' '--enable-magic-quotes' '--with-mysql' '--with-pear' '--enable-sockets' '--enable-track-vars' '--enable-versioning' '--with-zlib'
Server API CGI
Virtual Directory Support disabled
Configuration File (php.ini) Path /usr/local/lib/php.ini
PHP API 20020918
PHP Extension 20020429
Zend Extension 20021010
Debug Build no
Thread Safety disabled
Registered PHP Streams php, http, ftp, compress.zlib

_ENV["SERVER_SOFTWARE"] Apache/1.3.29 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.2 FrontPage/5.0.2.2634 mod_ssl/2.8.16 OpenSSL/0.9.6b PHP-CGI/0.1b
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

Looks correct (?).
Verified on http://www.devarticles.com/c/a/Apache/U ... ge_URLs/1/
Stumped, better let the apache gurus answer that one...

The below might be useful also:

Code: Select all

<Location /phpfiles>
      ForceType application/x-httpd-php
    </Location>
davem
Forum Newbie
Posts: 2
Joined: Tue Jan 06, 2004 3:39 pm
Location: MI

Post by davem »

Hi JAM, thanks for the reply. Do Apache gurus hang out here, or could you recommend another forum I could post to?

Thanks,
Dave
Post Reply