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.
I have:
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
\\Apache2.2
\\conf
httpd.conf
mime.types
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?
I just tried that — while it works fine on the production server (which was working OK anyway), it still doesn’t seem to work on the testing server. Here’s the full code:
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.
Are the images processed by PHP before being output to the server?
In that case, the code (in Drupal, I guess) that processes the images should be outputting the image/png header.
If you put a png image in your websrver’s root, and request it directly, what headers are sent?