This continues on from the 'PHP hosting recommendations' thread below, but the discussion had moved so far off php recommendations that I thought I should start another thread. It is also related to this thread which I posted in may:
The reason that the thread was titled 'hosting recommendations' is that I've been searching for a soloution to a problem caused by settings on my remote server, and I was about to throw in the towel and find another one.
The problem, or so I believed, is caused by the upload_tmp_dir setting in the php.ini on my server not being set to a temporary directory, which I thought prevented me from using php's http file upload functions However, lots of advice I am getting from other sources is telling me that this is unnecesary to making http file uploads work with php.
I sent an email to dathorn.com (a hosting provider) explaining my problem, and asked them about their upload_tmp_dir setting and he replied with the following:
Likewise I've found a section in the php manual that says:
After a few email replies from my hosting company that were little more that yes or no, I managed to get the following out of them(I'm guessing that this one may hold the key to solving my problem. I'm hoping the second part sounds a little less existential to you than it does to me):
So my question is this (at last!). Can anyone tell me (or point me in the direction of a resource that could tell me) how I would go about utilizing this /tmp directory for file upload, given the last quote(the running as nobody one) from my hosting company?
Cheers! (sorry it was so long, thought I might as well give the full SP).
--
Note to Ingresman - Thanks a lot for all your help m8, but I can't get your script to run on my machine. I've tried every which way.
__
The reason that the thread was titled 'hosting recommendations' is that I've been searching for a soloution to a problem caused by settings on my remote server, and I was about to throw in the towel and find another one.
The problem, or so I believed, is caused by the upload_tmp_dir setting in the php.ini on my server not being set to a temporary directory, which I thought prevented me from using php's http file upload functions However, lots of advice I am getting from other sources is telling me that this is unnecesary to making http file uploads work with php.
I sent an email to dathorn.com (a hosting provider) explaining my problem, and asked them about their upload_tmp_dir setting and he replied with the following:
When uploading through php using the php FILE features, the files are first uploaded to the /tmp directory. You may then copy it to your home directory. This is the way it is normally done by php programmers.
Likewise I've found a section in the php manual that says:
upload_tmp_dir
The temporary directory used for storing files when doing file upload. Must be writable by whatever user PHP is running as. [highlight]If not specified PHP will use the system's default.[/highlight]
After a few email replies from my hosting company that were little more that yes or no, I managed to get the following out of them(I'm guessing that this one may hold the key to solving my problem. I'm hoping the second part sounds a little less existential to you than it does to me):
PHP should currently upload correctly, and temp sessions are stored in /tmp/
php is running as nobody therefore the user nobody need to be able to write to any files and directories you are manipulating with php. What you need to do is make the directory owned by nobody or (less secure) writeable by all.
So my question is this (at last!). Can anyone tell me (or point me in the direction of a resource that could tell me) how I would go about utilizing this /tmp directory for file upload, given the last quote(the running as nobody one) from my hosting company?
Cheers! (sorry it was so long, thought I might as well give the full SP).
--
Note to Ingresman - Thanks a lot for all your help m8, but I can't get your script to run on my machine. I've tried every which way.
__