I have a development Drupal 6.19 / WAMP setup that’s giving me some headaches. Among the mysteries are some apparently broken image paths that appear to be pointing to the correct locations/files. On inspecting the image in Chrome developer tools (under the “resources” tab), I find: mime-type = application/x-httpd-php.
image/png png defined in file mime.types
mime.types is included in httpd.conf via TypesConfig conf/mime.types
since it’s a WAMP server we also have LoadModule mime_module modules/mod_mime.so
and finally the php.ini has only default_mimetype = “text/html”
Apache directory structure:
\\Apache Software Foundation
Note that httpd.conf & mime.types are in the same directory.
Am I missing something here? Is the path to mime.types supposed to be relative to httpd.conf, or to the PHP root folder? or is the problem in Drupal?
It turns out it was an .htaccess issue. I’ve got a rewrite rule that looks for image files & runs a PHP script to watermark them. It works fine on my production server, but for some reason I haven’t figured out, bollixes the development server.
My version of the script includes the changes found in my comment to the article, namely, repositioning the watermark & using an if loop to prevent watermarks on smaller images. Oh, I guess I didn’t post the if loop. So if any one is interested, it’s just:
The closest thing to a root folder is the “sites” folder, since I’m running a multi-site setup w/ single codebase. If I drop the PNG there, I can view it & it appears to be the correct MIME type.
No clue which PHP in Drupal might be processing the image before the browser sees it. I’m using a couple of Drupal modules (Image & Image Assist) + the ImageMagick Toolkit, so there’s a lot going on w/ it – but I can tell you, they are creating a PNG file; it’s just not accessible thru the website.