0

I have a web application developed in a local PC in Windows using

  • PHP 5.4.25
  • Apache 2.4.7
  • XAMPP 1.8.2

Now I want some files to be copied from a file server built in IIS 7 which is in the same network.

IIS 7 listens at random port number starting from 65000, other than this I have no idea how it was set up.

I have tried the following methods

  • ftp_login() with proper username & password which has every rights
  • copy('\\servername\folder\test.txt','path\to\my\folder')
  • file_exists('\\servername\folder\test.txt')
  • fopen('\\servername\folder\test.txt')
  • opendir('\\servername\folder\')
  • scandir('\\servername\folder\')

But PHP error says, Permission denied or Access is denied. Sometimes it says, "The server has actively refused connection"

My question is what changes should I make in IIS 7 or in my web application.

I will answer any further questions on this. Thanks in advance.

1 Answers1

0
  1. Find out which user account is being used by Apache (details)
  2. IIS may be unrelated, if you want Apache to have the same user permission as IIS, you can try to use IIS user details
  3. After deciding on the account, give that user read access to that folder, both as sharing permission and file system level (NTFS) permission.
Community
  • 1
  • 1
user145657
  • 31
  • 1
  • 1
  • 3
  • recommended reading on permissions http://blogs.msmvps.com/acefekay/2011/02/04/share-permissions-and-ntfs-permissions-folder-access-control-amp-folder-permissions/ – user145657 Apr 30 '15 at 13:01
  • detailed: http://www.howtogeek.com/72718/how-to-understand-those-confusing-windows-7-fileshare-permissions/ – user145657 Apr 30 '15 at 13:02