You are here: Re: copy()-problem over a network « PHP Programming Language « IT news, forums, messages
Re: copy()-problem over a network

Posted by Kimmo Laine on 01/02/06 14:26

"Marcel" <info@nospam-bluegumdata.com.au> wrote in message
news:43b91878@duster.adelaide.on.net...
>
> "Marcel" <info@nospam-bluegumdata.com.au> wrote in message
> news:43b917c6@duster.adelaide.on.net...
>> "Marcel" <info@nospam-bluegumdata.com.au> wrote in message
>> news:43b8db48@duster.adelaide.on.net...
>> > Hello,
>> > I have a problem with accessing files on other computers in my network.
>> > The network is a Windows 2000 workgroup network and I have
>> > administrator
>> > rights....
>> >
>> > This works (from the directory copytest I copy something to copytest2):
>> >
>> > <?php
>> > copy('05_17340.jpg', 'D:\\copytest2\\test.jpg');
>> > ?>
>> >
>> > The next bit does not do the job (from the same directory to a
>> > networked
>> > one):
>> >
>> > <?php
>> > copy('05_17340.jpg', 'V:\\copytest2\\test.jpg');
>> > ?>
>> > It gives me the following message:
>> > Warning: copy(V:\copytest2\test.jpg): failed to open stream: Permission
>> > denied in D:\localweb\copytest\copytest.php on line 2
>> > (\\\computername\\sharename gives the same message).
>> >
>> > Any thoughts on this?
>> > Thanks,
>> > Marcel
>> >
>>
>> A small addition:
>> Replacing the copy command with exec('copy d:\localweb\copytest\*.*
>> v:\copytest2\*.*' ) doesn't work either. When I issue the same command
> from
>> the DOS-prompt (copy d:\localweb\copytest\*.* v:\copytest2\*.*), it
> works...
>> Why, why, why?
>>
>>
> Maybe this helps: the local webserver runs with Apache 2.0.55 (Win32) and
> PHP 4.4.1


The web server runs with different user rights than you as the admin. You
need to grant the same rights to the web server user, so it has permission
to write to the network drive. Maybe create a new account on the network
drive for the server. I don't know about apache, but IIS servers username is
usually something like IUSR_<COMPUTERNAME>, like IUSR_WEB or IUSR_SERVER or
whatever... That user role needs to have access to the remote filesystem
too.

--
"En ole paha ihminen, mutta omenat ovat elinkeinoni." -Perttu Sirviφ
spam@outolempi.net | Gedoon-S @ IRCnet | rot13(xvzzb@bhgbyrzcv.arg)

 

Navigation:

[Reply to this message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация