logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Apache seems to (try to) read images as ascii files...
Author
elwoody



Joined: 05 Oct 2006
Posts: 5
Location: SFCA

PostPosted: Mon 30 Oct '06 23:03    Post subject: Apache seems to (try to) read images as ascii files... Reply with quote

Friends: my 1st apache installation. Have the weird, yet probably simple conundrum described below...

Thanks!
E

**************************************
My url:

http://localhost/slides/picture001.jpg

**************************************
My Apache output:

Warning: Unexpected character in input: '' (ASCII=30) state=1 in C:\website\slides\picture001.jpg on line 186

Warning: Unexpected character in input: '' (ASCII=1Cool state=1 in C:\website\slides\picture001.jpg on line 186

Parse error: parse error, unexpected T_STRING in C:\website\slides\picture001.jpg on line 186


************************************
I gotz:
Apache 2.0.59
Php 5.1.6
WXPP-SP2

Server runs fine for everything but some images (png's sometimes work).
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7298
Location: Germany, Next to Hamburg

PostPosted: Mon 30 Oct '06 23:12    Post subject: Reply with quote

Seems that PHP tries to parse that picture. Is there any PHP installation ? Wink
Back to top
elwoody



Joined: 05 Oct 2006
Posts: 5
Location: SFCA

PostPosted: Mon 30 Oct '06 23:39    Post subject: Reply with quote

Yup,
I gotz:
Apache 2.0.59
Php 5.1.6
WXPP-SP2
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7298
Location: Germany, Next to Hamburg

PostPosted: Tue 31 Oct '06 11:02    Post subject: Reply with quote

Please see if there is any .htaccess file in the slide folder.

Watch for xbithack

or in your httpd.conf is a mistake. That all files are assoiated with PHP.

What is after AddType application/x-httpd-php ?
Back to top
elwoody



Joined: 05 Oct 2006
Posts: 5
Location: SFCA

PostPosted: Tue 31 Oct '06 18:25    Post subject: Reply with quote

Good evening Mr. Blond!

>>Please see if there is any .htaccess file in the slide folder.

None.

>>Watch for xbithack

I am researching this. The Server uses a largely default config, except for changes made for PHP/MySQL. This is a local development deployment.

>>>or in your httpd.conf is a mistake. That all files are assoiated with PHP.

>>>What is after AddType application/x-httpd-php ?

ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php .php5
Action application/x-httpd-php "/php/php-cgi.exe"
SetEnv PHPRC "C:/php"

This is what I know...

Thanks,

Derick
[/quote]
Back to top
pnllan



Joined: 05 Dec 2005
Posts: 221

PostPosted: Tue 31 Oct '06 19:03    Post subject: Reply with quote

At the beginning of this thread, you state that your issue deals with images, JPG's in particular.

I'm trying to understand how JPG's (as well as PNG's) and PHP coincide. Are the images being called through PHP script? Are you using some sort of 'broad-spectrum' imaging filter via PHP? The "unexpected T_STRING" looks like something that PHP would generate as an error. If the images are being generated or 'called' by PHP, then show us the relevant PHP script, please. Unexpected T_STRINGS error, at least in PHP, usually indicates a syntax error in the script.

If PHP IS NOT being utilized to generate or pass HTML via an IMG tag (if even then), then the issue is the Apache Configuration, and most likely MIME related.
Back to top
elwoody



Joined: 05 Oct 2006
Posts: 5
Location: SFCA

PostPosted: Wed 01 Nov '06 20:29    Post subject: Reply with quote

If PHP IS NOT being utilized to generate or pass HTML via an IMG tag (if even then), then the issue is the Apache Configuration, and most likely MIME related.

pnllan:

I suspect you're right. I mentioned PHP because 1) the server is trying to interpret the images as php, and 2) my knowledge of apache management is limited and I wanted to provide all possible detail.
Back to top
pnllan



Joined: 05 Dec 2005
Posts: 221

PostPosted: Wed 01 Nov '06 20:50    Post subject: Reply with quote

Are you using an image gallery application like ImageFolio or Coppermine?

If you create a NEW HTML (not PHP) page with a link to an image, is the image displayed in a browser?

Just making sure, but do you have the following in your Apache Conf file:

LoadModule mime_module "modules/mod_mime.so"

TypesConfig "conf/mime.types"
Back to top


Reply to topic   Topic: Apache seems to (try to) read images as ascii files... View previous topic :: View next topic
Post new topic   Forum Index -> Apache