title: imagegif() function not working properly
body: <p>Hello everyone I am trying to write a string on image during runtime and for this purpose I am using <code>imagestring</code> from GD, but am not getting the required output instead its giving met his error:</p>
  
  <p><code>imagegif(): Unable to open 'temp/textImage.gif' for writing: No such file or directory in … on line 157 Warning:</code></p>
  
  <p>However this same code was working fine with <code>imagefttext()</code> function, but as my hosting provider <code>heroku</code> does not support freetype library so that’s why ive to switch.</p>
  
  <pre><code>        $message = “Hello World”;
          //Image Processing:
          $imageUrl = "image.gif";
          $imageId = imagecreatefromgif($imageUrl);
  
          $angle = 0;
          $xCord = 4;
          $yCord = 40;
          $imageColor = imagecolorallocate($imageId, 0, 0, 0);
          $fontUrl = "GOTHIC.TTF";
          $imageText = "HELOOOO";
          $imageTextLnght = strlen($imageText);
          $fontSize = (500 / $imageTextLnght) + 5;
          $imageFont = 1;
  
  //imagefttext($imageId, $fontSize, $angle, $xCord, $yCord, $imageColor, $fontUrl, $imageText);
          imagestring($imageId, 5, $xCord, $yCord, $imageText, $imageColor);
          //header('Content-Type: image/gif');
  
          //Saving Image With Text:
          $textImage = 'temp/textImage.gif';
          imagegif($imageId, $textImage);
          imagedestroy($imageId);
  </code></pre>
  
  <p>Kindly help me with this:
  Thankyou</p>