Images on my localhost wampserver generated via PHP are send as text although the header image/jpg
Posted by: ThiemelJiri (---.13.broadband14.iol.cz)
Date: January 21, 2013 05:30PM

I'm experiencing problem with my localhost wampserver which I cannot figure out. The webpage I'm working on has already been created by me on my machine and uploaded via FTP. It's 100% working OK. Now (1 year after and after reinstall of my PC) I'm trying to make some changes. But all gets stucked on images processed wrong by PHP script. There are also already generated images in cache, which are only send to increase performance. These cached images are generated perfectly well. But the problem is, that the browser cannot display them, because they are not binar. I checked the data generated by original site - they look the same, but binar. IrfanView can even display these images generated by my new server. But browsers cannot.

Could someone, plese, tell me what possibly could cause this?

Site on webhosting server: [bearded-collie.bila-kaifa.com] (which is perfectly normal!)

Printscreen of broken website on my localhost: [bearded-collie.bila-kaifa.com]

The header seams OK to me:

Request URL:[localhost]
Request Method:GET
Status Code:200 OK
Request Headersview source
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding:gzip,deflate,sdch
Accept-Charset:windows-1250,utf-8;q=0.7,*;q=0.3
Accept-Language:cs,en-US;q=0.8,en;q=0.6,en-GB;q=0.4
Cache-Control:max-age=0
Connection:keep-alive
Cookie:user-admin=0b638454650527496b14215bd0f654e1; lang=cs; secureimage=fb39e1b6fbcef8af3ccbe8ec863d5026
Host:localhost
If-Modified-Since:Wed, 01 Aug 2012 18:48:22 +0000
Referer:[localhost]
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17
Query String Parametersview sourceview URL encoded
200:
Response Headersview source
Connection:Keep-Alive
Content-Type:image/jpeg
Dateconfused smileyun, 20 Jan 2013 12:28:02 GMT
Keep-Alive:timeout=5, max=98
Last-Modified:Wed, 01 Aug 2012 18:48:22 +0000
Server:Apache/2.2.22 (Win64) PHP/5.3.13
Transfer-Encoding:chunked
X-Powered-Bytongue sticking out smileyHP/5.3.13

Options: ReplyQuote
Re: Images on my localhost wampserver generated via PHP are send as text although the header image/jpg
Posted by: RiggsFolly (---.as13285.net)
Date: January 25, 2013 02:51AM

Check your httpd.conf file

Look for the keyword AddType

You need one of these for each MIME type your server will be sending to the browser, or your code needs to send specific headers.


For example I had to add these so I could send video files to a browser so that the browser knew what to do with them. These are examples only, please look up the correct mime types for the types of images you are sending.

AddType audio/mpeg mp3
AddType audio/mp4 m4a
AddType video/mp4 mp4
AddType video/mp4 m4v
AddType audio/ogg ogg
AddType audio/ogg oga
AddType video/ogg ogv
AddType audio/webm webma
AddType video/webm webm
AddType video/webm webmv
AddType audio/wav wav

Options: ReplyQuote


Sorry, only registered users may post in this forum.