compgeek83 Posted November 2, 2010 Share Posted November 2, 2010 I'm running the LAMP stack on ubuntu 10.04. trying to display dynamically generate images using GD or otherwise, even tried off the shelf software for the heck of it, that doesnt work either. All I get, whether I open my test website in IE or Firefox, local or remote, is the filename of the image instead of the desired generated image. any ideas? safe_mode is not on Quote Link to comment https://forums.phpfreaks.com/topic/217579-php-not-able-to-render-generated-images/ Share on other sites More sharing options...
PFMaBiSmAd Posted November 2, 2010 Share Posted November 2, 2010 We cannot really help you without seeing both your HTML and your php code that produces (reproduces) the symptom. Do web pages work at all? It's likely you are outputting some characters (possibly the Byte Order Mark characters that your editor places at the start of a UTF-8 encoded file) thing before the content-type header and the header() is not actually working. Quote Link to comment https://forums.phpfreaks.com/topic/217579-php-not-able-to-render-generated-images/#findComment-1129521 Share on other sites More sharing options...
compgeek83 Posted November 2, 2010 Author Share Posted November 2, 2010 this is the code I'm trying, although I get the same results with other php scripts I've tried this isn't specifically what I'm trying to accomplish, just some code I found online, but still it should work <? // show the correct header for the image type header("Content-type: image/jpg"); // an email address in a string $string = "email@example.com"; // some variables to set $font = 4; $width = ImageFontWidth($font) * strlen($string); $height = ImageFontHeight($font); // lets begin by creating an image $im = @imagecreatetruecolor ($width,$height); //white background $background_color = imagecolorallocate ($im, 255, 255, 255); //black text $text_color = imagecolorallocate ($im, 0, 0, 0); // put it all together imagestring ($im, $font, 0, 0, $string, $text_color); // and display imagejpeg ($im); ?> and the results of that script produce nothing but one line of text that contains the url to where the page is at http://192.168.2.2/webapp/testpage.php Quote Link to comment https://forums.phpfreaks.com/topic/217579-php-not-able-to-render-generated-images/#findComment-1129527 Share on other sites More sharing options...
compgeek83 Posted November 3, 2010 Author Share Posted November 3, 2010 anyone have any suggesstions? Quote Link to comment https://forums.phpfreaks.com/topic/217579-php-not-able-to-render-generated-images/#findComment-1129924 Share on other sites More sharing options...
PFMaBiSmAd Posted November 3, 2010 Share Posted November 3, 2010 I don't think your statement of what you did and what the result was is clear to anyone. What is the file name of the code you posted? What URL are you entering into your browser? What is the result you get in the browser window? What does a 'view source' in your browser show? Quote Link to comment https://forums.phpfreaks.com/topic/217579-php-not-able-to-render-generated-images/#findComment-1129925 Share on other sites More sharing options...
compgeek83 Posted November 3, 2010 Author Share Posted November 3, 2010 What is the file name of the code you posted? test.php What URL are you entering into your browser? 192.168.2.2/test.php What is the result you get in the browser window? http://192.168.2.2/test.php What does a 'view source' in your browser show? nothing as the browser thinks I'm viewing an image Quote Link to comment https://forums.phpfreaks.com/topic/217579-php-not-able-to-render-generated-images/#findComment-1129959 Share on other sites More sharing options...
PFMaBiSmAd Posted November 3, 2010 Share Posted November 3, 2010 Here's another question that someone already had asked - Do web pages work at all? Quote Link to comment https://forums.phpfreaks.com/topic/217579-php-not-able-to-render-generated-images/#findComment-1129972 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.