Re: [PHP] problem with imagecreate on new webserver

This is a discussion on Re: [PHP] problem with imagecreate on new webserver within the PHP General forums, part of the PHP Programming Forums category; On Sat, December 16, 2006 2:53 pm, macha@kingdomsend.com wrote: > i am moving my webserver from a ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-18-2006
Richard Lynch
 
Posts: n/a
Default Re: [PHP] problem with imagecreate on new webserver





On Sat, December 16, 2006 2:53 pm, macha@kingdomsend.com wrote:
> i am moving my webserver from a windows box to a linux box with php
> ver
> 5.2.0 and noticed i am having a problem with a php file(code below). i
> thought it was a module i was missing but looking at the php config
> file all the same modules are loaded. allow_url_fopen is enabled. what
> would i be missing in the php install that would make this code not
> work correctly from one machine to the other.
>
> when loading on the new box all i get is a image with
> 'http://localhost/imgfile.php'
>
> <?
> session_start();
> define( 'SITE' , 'http://localhost' );
>
> //define 7char code
> $md5 = md5(microtime() * mktime());
> $string = substr($md5,0,7);
>
> //create image



Take OUT the following line temporarily, and surf directly to the SRC
of the image:
> header("Content-type: image/png");


PHP will probably be spewing out error messages there for you to look at.

> $img= imagecreatefrompng(SITE. '/images/img.png');
> $white = imagecolorallocate($img, 233, 239, 239);
> $line = imagecolorallocate($img,233,239,239);
>
> for ($i = 1; $i <= 5; $i++) {
> $x1 = rand(1,149);
> $x2 = rand(1,149);
> $y1 = rand(1,49);
> $y2 = rand(1,49);
>
> imageline($img, $x1, $y1, $x2, $y2, $line);
> }
>
> //put code in image
> imagestring($img, 5, 35, 25, $string, $white);
>
> //save key to session
> $_SESSION['key'] = md5($string);
> imagepng($img);
> ?>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:33 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0