attachment problem

Jason Keltz jas@cs.yorku.ca
Thu, 23 Nov 2000 10:14:43 -0500 (EST)


Hi.

I have just went through the installation of:

mysql-3.23.27-beta
php-4.0.3pl1
horde-1.2.3
imp-2.2.3

Everything is working great with the exception of one thing.

When I am in compose and attempt to attach a file, I get a message like
this:

Warning: Unable to open '/tmp/phpWiaiNf' for reading: No such file or
directory in /cs/dept/www/horde/imp/compose.php3 on line 911

I have isolated the problem.  I just don't know how to fix it because I
know nothing about PHP.

There are actually two problems:

1) In horde/imp/compose.php3, there is a function "tmpdir" that looks
   like this:

function tmpdir()
{
    $tmp = get_cfg_var('upload_tmp_dir');
    if (empty($tmp)) {
        $tmp = getenv('TMPDIR');
    }
    return (empty($tmp) ? '/tmp' : $tmp);
}

Though I have set "upload_tmp_dir" to "/var/tmp" in php.ini, the return
statement ends up returning "/tmp".

"TMPDIR" does not exist as an environment variable.

If I change the "/tmp" in the return to "/var/tmp", everything works which
proves that TMPDIR isn't set.

I know that my php.ini path is being read because I have to set these
values for horde/imp, and that works fine.

  extension=imap.so      ; Added for IMAP support
  extension=mysql.so     ; Added for MySQL support

2) At least on my system, the difference between /tmp and /var/tmp is
   that /tmp is mounted on swap, and /var/tmp is disk.  The
   permissions, and ownership are exactly the same.  I'm not quite
   sure how this makes a difference to any program -- /tmp should have
   worked here, but it's nice that it did make a difference because it
   obviously uncovered a problem.

I have temporarily changed the return statement to return "/var/tmp", and
attachments work, but I'd rather understand why the original code is
failing for me.

Thanks for any help you can provide!

Jason Keltz
jas@cs.yorku.ca

ps: I'm not on the mailing list, so I would really appreciate if you would
    CC: replies directly to me.