Forum Moderators: coopster

Message Too Old, No Replies

tmp dir's and open_basedir restrictions

we've set the temp dir to the local site, but it doesn't always work!

         

mipapage

5:38 pm on Feb 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Okay, following some excellent help [webmasterworld.com] (and patience!) from BitBanger and justageek, I believe that I've isolated my image uploading problem.

I've contacted my host to see what they have to say, but I thought we licked this problem before:


safe_mode and open_basedir restrictions are in effect, so we set the php_admin_value open_basedir to:

/usr/www/mycurrentheadache.com/:/var/tmp

Great. The script worked like a charm until this past week, when it started failing to upload *sometimes*.

When it succeded, it reads:
Temp Filename:
/var/tmp/php9thld3

When it fails it reads:
Temp Filename:
/tmp/phpGvLor6,
ERROR opening file /tmp/phpGvLor6 - Size

I'm assuming that when it succeeds it's using the tmp dir local to the site, but when it fails it seems to be using the root tmp dir.

  1. Is this right?
  2. What the heck is going on?

this makes no sense to me!

coopster

10:01 pm on Feb 2, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member




open_basedir [php.net]

When a script tries to open a file ... the location of the file is checked. When the file is outside the specified directory-tree, PHP will refuse to open it. All symbolic links are resolved, so it's not possible to avoid this restriction with a symlink.


open_basedir......../usr/www/mycurrentheadache.com/:/var/tmp
path upon failure.../tmp/phpGvLor6

Have you asked the server admin to have a look at the

open_basedir
paths in the
php.ini
and compare them to the directory being used upon failure? Looks like an issue to me...

mipapage

10:23 pm on Feb 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks coopster,

I am having them look into it. I had already asked them to make sure the temp path (in msg one) was set, so now they're going back to check out why this may be failing.

It's been a battle! (not with them, but the bug)

- mipapage

mipapage

11:29 pm on Feb 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



coopster,

Here's the reply:

"as far as i know, open_basedir in httpd.conf overrides the php.ini value.
for reference, the php.ini value is

open_basedir .

but i can't change that to anything domain specific."

Makes sense to me, as far as I can tell. We're still talking, checking logs etc.

mipapage

9:27 am on Feb 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Cool - probelm solved. Seems it was a 'server configuration problem' - One of the servers was slightly different than the others...

coopster

2:14 pm on Feb 4, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Hey mipapage, is that all they gave you?

The reason I ask is that it would be nice to post the exact cause here in this forum for other folks to see, especially those that run into the same issues you did. That way they won't have to go through days of troubleshooting (like you did). If they would be so kind as to let you know exactly what the change was that corrected the action, please post it for us. Thanks!

Update
OK, I just read the other thread that gives the details:
Troubles Uploading Images [webmasterworld.com]

<edit>Found the answer was already posted in the other thread related to this issue</edit>

mipapage

3:14 pm on Feb 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Right. I should have posted a link to that thread. I'll hopefully be posting the 'configuation problem' there when I get the word on what it was...