# Generate $im and Stuff
# Now Output it
$file = "./temp.png";
I'm not sure what you expect to happen, these are the headers being returned:
CF-Cache-Status MISS CF-RAY 21cddbcc942220ae-LAX Cache-Control no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Connection keep-alive Content-Encoding gzip Content-Type text/html; charset=UTF-8 Date Fri, 28 Aug 2015 06:11:24 GMT Expires Thu, 19 Nov 1981 08:52:00 GMT Pragma no-cache Server cloudflare-nginx Transfer-Encoding chunked Vary Accept-Encoding X-Powered-By PHP/5.4.41-0+deb7u1
So first off, you are returning text/html. That is not the proper mime type for a .png image.
Secondarily, your script needs to actually return .png data.
I'm assuming here you plan to create the .png in your script using GD or ImageMagick, but whatever you plan to do, nothing will appear when an image is expected, when you don't actually provide the proper mime type and the proper image data that is expected to follow that mime type.
Setting the mime type at the top of your script is as easy as:
You are also going through Cloudflare. You should have Cloudflare turned off until you've debugged things and are sure that the script is operating as expected.