Reputation: 845
I have two virtual systems for development. First one is Windows + xampp (apache, php, mysql) and second one is Linux + apache + php + mysql. I have very very simple page that loads images from database (yes, images are in the database not on the filesystem, it is not the case here, is it right or not) using external links.
The first page shows photos:
<img src="photo.php?photo_id=4" height="127" width="127">
The second page loads them from database:
if (isset($_GET['photo_id'])) {
$link = getDBconnection();
$result = getPhoto($link, $_GET['photo_id']);
if ($result) {
$row = mysql_fetch_assoc($result);
header("Content-type: " . $row['MIMEtype']);
echo $row['photoImage'];
}
closeDBconnection($link);
}
Everything is working fine on the Windows machine but on the linux machine, pictures just don't show up. I mean image files from page directory loads up and shows up but somehow this external link stopped working. I've places few echos and for sure script executes and photoImage has binary data.
I wonder, is it just configuration issue (probable, am not configuring apache/php/mysql every day). I've stuck at that point. Any ideas?
PS. Database is exactly the same. I've just exported/imported it from Windows to Linux mysql database. Any other data is successfully selected from database. It's just the photos, that don't work.
SOLVED
Thanks Marc B for the tip about encoding. I was aware of the possible issue but completely forgot about it. After copying the files once more time to the LINUX machine via ftp, and after double checking that I did not change encoding (by editing any file), the photos showed up.
Upvotes: 1
Views: 714
Reputation: 360612
Some things to check:
Upvotes: 1