Unable to connect to network share

前端 未结 2 1034
轻奢々
轻奢々 2020-12-20 09:57

I\'m trying to connect to a network share (by it\'s UNC) from the browser, but am unable to.

If I run my script from the command line, everything is fine and I can a

相关标签:
2条回答
  • 2020-12-20 10:10

    You cannot use a UNC path in PHP to access files easily.

    Try making a mapped Network Drive.

    0 讨论(0)
  • 2020-12-20 10:35

    It should work but you need the user who runs the php process to have access to the path.

    In your case, if not in a domain, you can try to create a user on your server and set it as the application pool owner. Then you create the same user/password on the other computer and give access to the shared folder.

    Looks ugly I agree but should work.

    EDIT

    Or yes, as suggested by Neal, create a mapped folder. May be easier.

    EDIT 2

    Assuming you are not in a domain, to create the user and assign it to run the application do as following:

    1. Create the user Create the user

    2. Run iismanager and set the user to run the application

    Assign the user to run your application

    The last step is to create the same exact user (password as well) on the remote server where you are sharing the path and add this user in the security tab with the rights you need.

    You may need to restart iis: iisreset

    0 讨论(0)
提交回复
热议问题