PHP Configuration for FM11 Server -- getimagesize() not working

Discussion created by rstory on Jan 7, 2015
Latest reply on Jan 14, 2015 by rstory

Hi all,


I've spent a bit of time googling this and I thought maybe someone here might have encountered the same problem.


Let's say I have the following php script:



$imgURL = '';


echo "<p>imgURL: $imgURL</p>";

echo "<img src=\"$imgURL\"><br />";


echo "<p>by URL:</p>";

list($imgWidth, $imgHeight, $imgtype, $attr) = getimagesize($imgURL);

echo "<strong>imgWidth:</strong> $imgWidth<br />

  <strong>imgHeight:</strong> $imgHeight<br />

  <strong>imgType:</strong> $imgtype<br />

  <strong>attr:</strong> $attr<br />";


echo "<p>by Static Image:</p>";

list($imgWidth, $imgHeight, $imgtype, $attr) = getimagesize("local_image.png");

echo "<strong>imgWidth:</strong> $imgWidth<br />

  <strong>imgHeight:</strong> $imgHeight<br />

  <strong>imgType:</strong> $imgtype<br />

  <strong>attr:</strong> $attr<br />";



When I load this page into the server which is running FM11 server with the FileMaker PHP installation, I get the following response:





by URL:


Warning: getimagesize( [function.getimagesize]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in [php script] on line 9





By Static Image:

imgWidth: 662

imgHeight: 163

imgType: 3

attr: width="662" height="163"

The fact that the image renders from the <img> call indicates that the url is fine, ContainerBridge is serving properly, etc.

So this is where it gets interesting:

In my development environment of PHP, which is NOT the filemaker configuration, the getimagesize function works fine and so I was happily programming away thinking it would transfer fine to the server. So I started digging and found some indication that the GD library needed to be enabled, so I went into the php.ini file in the FM Server directory (on the server) and uncommented that extension, restarted the server, and confirmed via phpinfo() that GD was working fine (and that cURL is working as well). But the script is still having trouble with this function, and I'm a little flummoxed. The image is definitely available, and my development environment had no trouble running the getimagesize() function off of a url. I'm pretty sure I just need to update/enable some environment variable, but I don't know what that might be. Any thoughts?