RE: [PHP] copy file from server to shared network folder
Thanks Rich Tom for all your help. Adding a user for apache on the remote PC's or modifying the user in httpd.conf did the trick. -Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED] Sent: Friday, April 20, 2007 3:48 PM To: Haig (Home) Cc: php-general@lists.php.net Subject: Re: [PHP] copy file from server to shared network folder While I don't claim to understand the Windows security model, or lack thereof, when you 2x click on something in Windows, you are you. When php does exec() php is *NOT* you. PHP is running with the permissions of the User setting in httpd.conf, whatever that means under Windows. What it means to you is that PHP User probably does NOT have permission to do what you are doing when you 2x click. Meanwhile, back at the ranch, if you are using exec() and you aren't using the optional argument to find out what error number the Operating System is giving you when it doesn't work, you're doing it wrong. :-) http://php.net/exec On Thu, April 19, 2007 11:04 pm, Haig (Home) wrote: Hi everyone, I can't seem to be able to copy a txt file from the server over to a network drive. Server is apache on winxp and the remote PC is also running XP. Remote folder is shared with all read/write rights enabled. I also tried executing a bat file where the bat file contains the copy command and that didn't work either. 2x clicking on the bat file works. I tried echo exec(c:\\test.bat); and also echo system (c:\\test.bat); and exec('c:\Windows\system32\cmd.exe /c START c:\test.bat'); and exec('c:\\Windows\\system32\\cmd.exe /c START c:\\test.bat'); with no success. The last 2 items did launch the cmd process. Any ideas? -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] copy file from server to shared network folder
While I don't claim to understand the Windows security model, or lack thereof, when you 2x click on something in Windows, you are you. When php does exec() php is *NOT* you. PHP is running with the permissions of the User setting in httpd.conf, whatever that means under Windows. What it means to you is that PHP User probably does NOT have permission to do what you are doing when you 2x click. Meanwhile, back at the ranch, if you are using exec() and you aren't using the optional argument to find out what error number the Operating System is giving you when it doesn't work, you're doing it wrong. :-) http://php.net/exec On Thu, April 19, 2007 11:04 pm, Haig (Home) wrote: Hi everyone, I can't seem to be able to copy a txt file from the server over to a network drive. Server is apache on winxp and the remote PC is also running XP. Remote folder is shared with all read/write rights enabled. I also tried executing a bat file where the bat file contains the copy command and that didn't work either. 2x clicking on the bat file works. I tried echo exec(c:\\test.bat); and also echo system (c:\\test.bat); and exec('c:\Windows\system32\cmd.exe /c START c:\test.bat'); and exec('c:\\Windows\\system32\\cmd.exe /c START c:\\test.bat'); with no success. The last 2 items did launch the cmd process. Any ideas? -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] copy file from server to shared network folder
Hi, Friday, April 20, 2007, 2:04:14 PM, you wrote: HH Hi everyone, HH I can't seem to be able to copy a txt file from the server over to a network HH drive. HH Server is apache on winxp and the remote PC is also running XP. HH Remote folder is shared with all read/write rights enabled. HH I also tried executing a bat file where the bat file contains the copy HH command and that didn't work either. HH 2x clicking on the bat file works. HH I tried HH echo exec(c:\\test.bat); HH and also HH echo system (c:\\test.bat); HH and HH exec('c:\Windows\system32\cmd.exe /c START c:\test.bat'); HH and HH exec('c:\\Windows\\system32\\cmd.exe /c START c:\\test.bat'); HH with no success. HH The last 2 items did launch the cmd process. HH Any ideas? Apache won't have rights to access the network, you need to read: http://httpd.apache.org/docs/1.3/win_service.html -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php