Error with imagegif() function

Problems with the Linux version of XAMPP, questions, comments, and anything related.

Error with imagegif() function

Postby edwin1 » 10. July 2005 20:10

Hello everyone,

I'm using the XAMPP for Linux 1.4.14, PHP 5.0.4 (although the problem I describe below also occurs with PHP 4.3.11) and Mandrake Linux 10.

Whenever I use the imagegif() function, I get the following error:

Warning: imagegif() [function.imagegif]: Unable to open temporary file in /path/to/script.php on line 6

I've seen the following bug:

This is exactly the same problem that I'm having (except I'm using Linux rather than Windows). The second bit of code posted on that page works fine, but the first one produces an error. It can't be a problem with the /tmp folder on the server because other features which require the temporary folder work (such as sessions and the second bit of code posted at the URL above).

The bug was reported back in August last year, so I don't believe it to be a problem with PHP any more. So could this be a problem with XAMPP? Perhaps somehow an updated file to fix this bug hasn't been replaced in the newest version of XAMPP? Is this a possibility?

Thanks for any help,

Posts: 2
Joined: 10. July 2005 20:01

Postby Oswald » 11. July 2005 22:13

Dear Edwin!

I just wrote a litte program for testing your problem:

Code: Select all
        header ( "Content-Type: image/gif" );

        $im  =  ImageCreate( 100,  100 );

        $fill  =  ImageColorAllocate ( $im ,  $r,  $g, $b );

        ImageFill ( $im , 0 , 0 , $fill );

        ImageGIF ( $im );

Please try it on your installation. For me it works fine with XAMPP 1.4.13. It should return you a orange 100 x 100 px square.

Best regards
User avatar
Apache Friends
Posts: 2718
Joined: 26. December 2002 19:51
Location: Berlin, Germany
Operating System: Linux

Postby edwin1 » 11. July 2005 23:21

Hi Oswald,

Thanks for replying.

I created a file with the code you posted, and the following error was produced:

<br />
<b>Warning</b>: imagegif() [<a href='function.imagegif'>function.imagegif</a>]: Unable to open temporary file in <b>/virtual/host9/htdocs/imagetest.php</b> on line <b>13</b><br />

Changing the function to imagejpeg() (as described in the bug report) produces the orange square fine. So since creating a jpeg file works, I would guess that rules out any permission problems on my server, but I'm not entirely sure.

Thanks for your help,

Posts: 2
Joined: 10. July 2005 20:01

Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 2 guests