If I was going to change the handling of an extension using .htaccess in a directory so that PHP would handle it, would I use text/html as the mime type.
Example:
text/html .jpg
This would be to force apache to threat any files with extension .jpg as a php file.
PHP MIME Type
Moderator: General Moderators
Is this a question? 
you registered (probably) application/x-httpd-php to be handled via php.and .gifs (edit:
.jpgs of course) will be handled by php.
you registered (probably) application/x-httpd-php to be handled via php.
So, e.g.AddType application/x-httpd-php .php
Code: Select all
AddType application/x-httpd-php .jpg
Last edited by volka on Thu Mar 13, 2003 1:56 am, edited 1 time in total.
Keep getting misconfiguration
I've tried all of the following and I keep getting a misconfiguration error.
Does anyone see a problem with this?
Also, how do I check what MIME Type PHP is set to on the server?
Code: Select all
<Files test.gif>
ForceType application/x-httpd-php
</Files>
and
ForceType application/x-httpd-php
and
AddType application/x-httpd-php .gifAlso, how do I check what MIME Type PHP is set to on the server?
http://httpd.apache.org/docs/mod/mod_mime.html#addtype
http://httpd.apache.org/docs/mod/mod_mime.html#forcetypeAddType directive
Override: FileInfo
Module: mod_mime
therefor you need mod_mime and maybe AllowOverride FileInfo or more.ForceType directive
Module: mod_mime
What are you putting that into?
I didn't get any of those to work in my .htaccess file but my
/etc/httpd/conf.d/php.conf
Had some lines kind of like that. Try puting this into the file
=D
I didn't get any of those to work in my .htaccess file but my
/etc/httpd/conf.d/php.conf
Had some lines kind of like that. Try puting this into the file
Code: Select all
<Files *.gif> //or you could do test.gif
SetOutputFilter PHP
SetInputFilter PHP
LimitRequestBody 524288
</Files>=D
I have a directory test on my personal (break-down) server, where I can play with all those settings. Currently the .htaccess contains
) httpd.conf contains AllowOverride All for the DocumentRoot-entry
but (since I stopped to fear my own curiosity long agophp_value session.gc_probability 100
php_value session.gc_maxlifetime 60
php_flag always_populate_raw_post_data On
AddType application/x-httpd-php .gif