move_uploaded_file from server to server

We would like to utlize the Move_Upload_File to get a file to another
web server.  We are currently using Windows Server 2003 with PHP on
them.  However I am sure I have a file permission issue on the
targetted server box (since its going from one box to another), but I
am not sure how to force PHP to use a specific user (since its a subset
of IIS, it almost looks like it uses Anonymous - which will not work
for the scenerio I am looking at that I am aware of).

Any Help would be appreciated - here is a snipet of our code:


move_uploaded_file($_FILES['upload']['tmp_name'],"\\server2\share\directory­\$filename")

gregsopcakAsked:
Who is Participating?
 
AndyAelbrechtCommented:
it is using the IISR_USR (or something very similar) as user.
if you want it to be able to access a share with a password, you have 2 choices:
either run PHP cgi as another user who does have access (i don't know how, though)
or
give the share write permissions for the IISR_USR user (which is imho, way more secure, especially if you only give him file creation rights; this way this user can never overwrite files there or even read them)
0
 
str_kaniCommented:
I would move it to the other server using ftp, that will be better and safe in my view.
0
 
gregsopcakAuthor Commented:
What are the FTP commands in PHP?

Thanks!
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Richard QuadlingSenior Software DeveloperCommented:
It makes little difference HOW you move the files between servers. As long as you have permissions, you can do it.

You COULD simply allow everyone access to the share!

As far as using FTP, you will need to have an FTP server running on the second server. There is no point in using FTP to do this.

You don't need it. Just get the permissions right. Try asking the permissions question in the IIS section http://www.experts-exchange.com/Web/Web_Servers/IIS

0
 
AndyAelbrechtCommented:
i have to stress how much I agree with RQuadling here and not with str_kani (sorry mate).

setting up an ftp server (which uses plain text passwords) to upload stuff to a directory that's already available on a local share is overkill and not needed. NTFS authentication is alot safer.

setting up an ftp server is just too much of a hassle, get the permissions on the folder right and you're done :-)
0
 
Richard QuadlingSenior Software DeveloperCommented:
Is your PHP fully active? Are you running safe mode or restricted directory usage?

There are many securities within PHP which could also stop you accessing the files.

0
 
gregsopcakAuthor Commented:
I did do an FTP and it worked great.. but I would still be interested in using the NTFS.. However its aniling down what user PHP is using to access it... I am not able to grasp it as its not a "service" but runs from IIS...

I am running in normal PHP in ISAPI mode... Its a precompiled version (I didnt compile it - downloaded it from php.net)
0
 
AndyAelbrechtCommented:
hey gregsopcak,

like i said in my first comment, the user that IIS runs under is the "IISR_USR" or something very similar.
just look thru your local users (on the server that is running the IIS) and you will find this user pretty fast.

give this user the proper NTFS rights on the share you want to access ! :)
0
 
Richard QuadlingSenior Software DeveloperCommented:
A daft way to find the IIS user is to create a directory with everyone having full rights.

Then use PHP to create a file in that directory.

Then check the owner.

I'm sure there are other ways, but with different versions of IIS the user changed.


You should be able to check the IIS service account within Control Panel -> Services. It probably will NOT be LocalSystem or NetworkService, but something else.

0
 
gregsopcakAuthor Commented:
I setup a copy of the IUSR on the other server and give it file rights to the share and etc, however its still not working...

As far as the IIS Admin Service account is setup as Local System I believe, not the IUSR user.. should I change that to be that IUSR on the server sending so hopefully it uses that?
0
 
Richard QuadlingSenior Software DeveloperCommented:
I think the IIS service is WWW Publishing or something like that? IIS Admin Service is a service to administer IIS which would only need local rights.

It may be better to ask this question (or at least put a pointer question) in the IIS section here on EE.
0
 
Richard QuadlingSenior Software DeveloperCommented:
Ah. It MAY be something like ...

DOMAIN\IWAM_SERVER or DOMAIN\IUSR_SERVER

So, say your domain is COUNTDOWN and the webserver is WWW, then try ...

COUNTDOWN\IWAM_WWW or COUNTDOWN\IUSR_WWW

0
 
Richard QuadlingSenior Software DeveloperCommented:
Split
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.