0

I'm currently moving to a VPS hosted on Windows 2008 but one of my scripts doesn't work now. The error I'm getting is:

Warning: imagegif() [function.imagegif]: Unable to open 'test.gif' for writing in C:\Inetpub\vhosts\footielegend.co.uk\httpdocs\ajax\kit.php on line 28

Firstly, I'd like to let you know I'm very familiar with Windows Permissions, so it's certainly not a permissions issue. Both the images exist (I've used the same directory just for ease of access). And this has come out of a working server onto a server, both hosting the same website.

$imgname = "1-1.gif";
$im = imagecreatefromgif ($imgname);

$primary = imagecolorexact($im, 255,0,0 );
imagecolorset($im,$primary,$aR,$aG,$aB);

$secondary = imagecolorexact($im, 0,255,0 );
imagecolorset($im,$secondary,$bR,$bG,$bB);

$imgname = "test.gif";
imagegif($im, $imgname);
imagedestroy($im);
Lightness Races in Orbit
  • 378,754
  • 76
  • 643
  • 1,055
DugoutSoccer
  • 422
  • 5
  • 19
  • 2
    Are you sure it's not a permission issue? Sure smells like it! Maybe you missed something? Can you write some other random data (with standard file functions) to "test.gif"? – Vilx- Dec 09 '11 at 09:43
  • yes, I write multiple textfiles. From the same location and to the same location. I moted it's a Windows Server as I was reading up on it and aparently some people have had issues with Windows but doing something with tmp helps, just these images are a little crazy =] – DugoutSoccer Dec 09 '11 at 10:13
  • Whoops, the other one is reading from another directory... Just noticed this one doesn't have read permissions!! Very sorry to waste your time :) Post the permissions as an answer and I'll accept it if you'd like. -Schoolboy error lol – DugoutSoccer Dec 09 '11 at 10:31
  • Your familiarity with "Windows Permissions" by no means proves that you got it right. – Lightness Races in Orbit Dec 09 '11 at 10:46
  • haha indeed. I thought I checked it properly, but seems it was just the single folder, and I had failed to check adaquately... just goes to show, check check and check again ;) Thank =] – DugoutSoccer Dec 09 '11 at 11:46

1 Answers1

2

It was a permissions issue after all. :)

Vilx-
  • 104,512
  • 87
  • 279
  • 422