Page 1 of 1

Re: Could not create temporary file

Posted: 2007-08-13T16:45:56-07:00
by anthony
The temporary directory IM is using is either not writable, does not exist, or is disk full.
on UNIX-like systems you can set the temporary directory location (defaults to /tmp) using the environment variable "MAGICK_TEMPDIR". Or the command line option "-set registry:temporary-path {dir}". Under windows this is set using Registry entry "HKEY_Current_User\Environment\TMP"

Re: Could not create temporary file

Posted: 2007-10-03T13:59:56-07:00
by MsXLabs
Hello,

I've the same problem. It happened after i upgraded apache from 1.3 to 2.2 and php from 4 to 5.

All four servers have this problem now after the upgrade. I tried to reinstall the latest version of ImageMagick (downloaded it 2 days ago) by using this tutorial:
http://www.vbulletin.com/forum/showthread.php?t=155636

How can fix this problem?

"Could not create temporary file."

Regards

Re: Could not create temporary file

Posted: 2007-10-07T17:49:10-07:00
by magick
ImageMagick should report why ImageMagick fails to create a temporary file. For example,
  • -> setenv MAGICK_TMPDIR /
    -> convert logo.ps logo.miff
    convert: unable to create temporary file `logo.ps': Permission denied.
    convert: missing an image filename `logo.miff'.
which correctly reports that the temporary file cannot be written to the root directory since the user does not have permission to create a file in that directory. What does ImageMagick report when you get the "unable to create temporary file" message?

Re: Could not create temporary file

Posted: 2007-10-07T18:15:11-07:00
by MsXLabs
[root@server ~]# setenv MAGICK_TMPDIR /
-bash: setenv: command not found
[root@server ~]# convert logo.ps logo.miff
convert: missing an image filename `logo.miff'.
[root@server ~]#

Check these screenshots please:
http://dts.msxlabs.org/NeutralizeR/Snap132.png
http://dts.msxlabs.org/NeutralizeR/Snap29.png

Re: Could not create temporary file

Posted: 2007-10-07T18:46:05-07:00
by anthony
You are probably use Bourne shell variant rather than Csh.
try...

Code: Select all

MAGICK_TMPDIR=/
export MAGICK_TMPDIR
However MAGICK_TMPDIR should be set to some directory that is writable!!!
Like some sub-directory of your home...

Code: Select all

mkdir $HOME/magick_tmp
MAGICK_TMPDIR=HOME/magick_tmp
export MAGICK_TMPDIR

Re: Could not create temporary file

Posted: 2007-10-07T18:56:14-07:00
by MsXLabs
[root@server ~]# MAGICK_TMPDIR=/
[root@server ~]# export MAGICK_TMPDIR
[root@server ~]# mkdir $HOME/magick_tmp
[root@server ~]# MAGICK_TMPDIR=HOME/magick_tmp
[root@server ~]# export MAGICK_TMPDIR
[root@server ~]# convert logo.ps logo.miff
convert: missing an image filename `logo.miff'.
[root@server ~]#


Still no changes at all.

http://www.msxlabs.org/forum/image.php?i=im

Could not create temporary file.

Re: Could not create temporary file

Posted: 2007-10-08T06:33:17-07:00
by magick
Perhaps you are missing Postscript support. Let's see if ImageMagick works from the command line. Do not set any environment variables and type:
  • convert logo: logo.miff
    convert logo.miff logo.pnm
If these commands fail, ImageMagick is not installed properly on your system. If they do work the temporary file problem is most likely related to you using ImageMagick from a scripting language whose environment/permissions differ than yours from the command line. Its possible, for example, that the script you are using sets the TMPDIR to a location where it does not have permission to write.

Re: Could not create temporary file

Posted: 2007-10-08T18:43:53-07:00
by MsXLabs
The commands worked.

But nothing changed at script side apart from Apache 2.2.6 update :(

Re: Could not create temporary file

Posted: 2007-11-18T10:20:16-07:00
by MsXLabs
Any solutions? I don't want to use GD. ImageMagick supports animated gif resizing...

Re: Could not create temporary file

Posted: 2007-11-18T10:41:33-07:00
by MsXLabs

Code: Select all

/**
	* See function definition in vB_Image_Abstract
	*/
	function print_image_from_string($string, $moveabout = true)
	{
		if ($this->registry->options['safeupload'])
		{
			$tmpname = $this->registry->options['tmppath'] . '/' . md5(uniqid(microtime()) . $this->registry->userinfo['userid']);
		}
		else
		{
			if (!($tmpname = @tempnam(ini_get('upload_tmp_dir'), 'vb')))
			{
				echo 'Could not create temporary file.';
				return false;
			}
		}
If i change the upload mode to safe mode, imagemagick's working.

What's the issue with the code above?

Re: Could not create temporary file

Posted: 2007-11-18T10:50:00-07:00
by MsXLabs
oh god, i changed the "upload_tmp_dir" value in php.ini to "upload_tmp_dir = /tmp" and the problem is fixed :)