Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6642515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:56:22+00:00 2026-05-25T23:56:22+00:00

I have two virtual systems for development. First one is Windows + xampp (apache,

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T23:56:23+00:00Added an answer on May 25, 2026 at 11:56 pm

    Some things to check:

    1. Check for database errors – you say the photoImage field has binary data, so not likely, but never ever assume a database call succeeded
    2. Check for early text output, causing the header() call to fail – it should be getting logged somewhere. Turn on display_errors/error_logging while developing, in any case, so you don’t have to rummage around in logs to find out what’s going wrong.
    3. Hit the url manually in a browser and see what comes through. Perhaps there’s some characterset translation going causing the image data to be corrupted (e.g. you’re using a TEXT field instead of a BLOB).
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to have two virtual directories under the same website in IIS
HELP! I just setup a virtual host for two sites that have a lot
I have two classes, and want to include a static instance of one class
I have two threads, one needs to poll a bunch of separate static resources
I have two spreadsheets... when one gets modified in a certain way I want
Model: I have a model in which one Installation can contain multiple Computer Systems.
I have two classes: public class DocumentViewModel { public virtual string DocumentNumber { get;
I have two servers (virtual machines - I can remotely connect to these) -
I've got a Windows 7 machine upon which I do both PHP/MySql Dev, and
I have two objects... and if I compile a program with either one, it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.