Click to See Complete Forum and Search --> : PHP is parsing my JPG files.


Anon
11-05-2000, 02:50 AM
I have PHP Version 4.0.1pl2, Apache/1.3.12 (Win32) and MySQL 3.23.10-alpha installed on my PC which is running WinMe. I have this problem on my PC that whenever I called a .html files which contains JPG image file, PHP always parse the JPG file instead of displaying it. So I ended up with a broken image. it works fine with GIF but not with JPG. I tried uploading on my server and it works. This problems only happens locally on my PC.

Can anyone help me? Could it be my configurations? Thanks in advance.

Anon
11-06-2000, 03:54 PM
That's very odd, since PHP will not parse anything unless Apache tells it to. Are you completely sure that PHP is trying to parse the JPEG images?

Try checking your Apache "httpd.conf" configuration file or the "mine.types" file to see how is Apache is associating JPEGs with that.

Anon
11-07-2000, 04:46 AM
I tried looking in httpd.conf and there's nothing on JPG files. Anyway, I am running PHP, Apache & MySQL on a Win98/ME system. By default PHP is installed as CGI script. Therefore, whenever I call a php file, the browser will change the URL from "http://localhost/myfolder/myfile.php" to "http://localhost/php/php.exe/myfolder/myfile.php". I think this somehow affect the parsing of the JPG file because once I manually removed the "/php/php.exe" the image will appear as usual.

So is there a way to make sure that the additional PHP informations (ie. /php/php.exe) from appearing whenever I called a php file?

Any help is greatly appreciated. Thanks.

Anon
04-22-2001, 02:50 AM
Delete this from your apache httpd.conf

ScriptAlias /php4/ "d:/php/"
Action application/x-httpd-php4 "/php4/php.exe"
AddType application/x-httpd-php4 .php

you do not need to load php as a script alias
use the module instead

all of parsing of images problems will be fixed when the above lines are removed

Allie Syadiqin wrote:
-------------------------------
I tried looking in httpd.conf and there's nothing on JPG files. Anyway, I am running PHP, Apache & MySQL on a Win98/ME system. By default PHP is installed as CGI script. Therefore, whenever I call a php file, the browser will change the URL from "http://localhost/myfolder/myfile.php" to "http://localhost/php/php.exe/myfolder/myfile.php". I think this somehow affect the parsing of the JPG file because once I manually removed the "/php/php.exe" the image will appear as usual.

So is there a way to make sure that the additional PHP informations (ie. /php/php.exe) from appearing whenever I called a php file?

Any help is greatly appreciated. Thanks.