#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2008
    Posts
    37
    Rep Power
    7

    IIS7 PHP access network file: access is denied error


    Hello,

    We just upgrade our webserver and we encountered some issue when using PHP system() to run a program in network drive.

    Here are some information:
    OLD server setting:
    IIS6
    PHP 5.3.1
    WindowsXP

    New Server:
    IIS7
    PHP 5.4
    Windows Server 2008

    Server and file structure:
    2 servers:
    Webserver: where the PHP files are located
    Fileserver: is mapped as S drive in Webserver

    In Webserver
    c:/inetpub/wwwroot/vi/testrun.php: call the wotx.lnk
    c:/inetpub/wwwroot/vi/wotx.lnk: a short cut to pvxwin32.exe in fileserver

    Filesever:
    Fileserver/MAS90/Home/pvxwin32.exe

    test.php:
    PHP Code:
    <?php
    system
    ('C:\Inetpub\wwwroot\vi\wotx.lnk 2>&1');
    ?>
    wotx.lnk:
    S:\MAS90\Home\pvxwin32.exe ..\LAUNCHER\SOTA.INI ..\SOA\STARTUP.M4P -ARG DIRECT UIOFF *** *** *** *** AUTO

    The same code was working perfect in the old server.
    But when we moved to the new server, I run test.php from browser, PHP system() gives me "access Denied" error.
    But if I run the php file in command line in webserver, it works fine.
    I think it might be permission issue.

    Here are some configuration in webserver:
    Default Application Pool --> Identity is set to Mydomain\web-server
    web-server is a domain account, not a local account

    Permission setting for wotx.lnk:
    web-server@Mydomain.local full control

    Permission setting for pvxwin32.exe in fileserver:
    web-server@Mydomain.local full control

    I have been working on this for several days and couldnot figure out how to fix it.
    Any help will be highly appreciated. Thank you very much.
    Last edited by 112233; November 30th, 2012 at 03:16 PM.
  2. #2
  3. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,446
    Rep Power
    4539
    I see you've moved your question here as well as in the php forum. I doubt there are many IIS/php users around here but we can always hope. I haven't used IIS since IIS6 and haven't setup php in IIS for years, so I won't be any help, sorry.

    I never knew you could even execute a shortcut from within IIS code, I don't think you can with classic asp anyway. I'd try to get rid of using a shortcut .lnk in your code for starters.

    Hopefully someone with more knowledge of newer IIS and NET servers will spot this thread.
    ======
    Doug G
    ======
    Bartender to Rene Descartes "have another beer?" Descartes: "I think not" and he vanished.
    --Alfred Bester
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2008
    Posts
    37
    Rep Power
    7
    Originally Posted by Doug G
    I see you've moved your question here as well as in the php forum. I doubt there are many IIS/php users around here but we can always hope. I haven't used IIS since IIS6 and haven't setup php in IIS for years, so I won't be any help, sorry.

    I never knew you could even execute a shortcut from within IIS code, I don't think you can with classic asp anyway. I'd try to get rid of using a shortcut .lnk in your code for starters.

    Hopefully someone with more knowledge of newer IIS and NET servers will spot this thread.
    Thank you very much for your reply.
    The shortcut was working fine before. So I am assuming it is some setting in the new server.
    I tried to remove the lnk and execute the exe file directly, but since it is in network drive, it kept giving me "cannot find the path" error.
  6. #4
  7. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,446
    Rep Power
    4539
    There have been a lot of changes between XP and W2008. First, XP isn't a server OS and may very well have some relaxed permissions in networking. Network access, firewalls, etc are all more restrictive with W2008 server.

    IIS authentication mechanisms have changed. IIS now supports 64 or 32 bit application pools, your XP machine was probably only 32 bit.

    IIS 5.1 is what you had on XP, IIS6 was only with Windows 2003 server. I don't think IIS 5.1 had the different anonymous IIS user accounts like IIS 6 & newer had, maybe you're working with the wrong user account for network access.

    Anyway, I'd review firewall/network settings, IIS authentication settings, 64/32 bit settings. IIS used to have pretty comprehensive online docs to help you with all this.
    ======
    Doug G
    ======
    Bartender to Rene Descartes "have another beer?" Descartes: "I think not" and he vanished.
    --Alfred Bester
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2008
    Posts
    37
    Rep Power
    7
    Thanks for all your help.

    Problem has been solved.

    Solution:

    changed the shortcut, in stead of using the mapped drive name, we changed to use the server name directly.

    Hope it will be helpful for someone.
  10. #6
  11. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,446
    Rep Power
    4539
    Thanks for posting your solution.
    ======
    Doug G
    ======
    Bartender to Rene Descartes "have another beer?" Descartes: "I think not" and he vanished.
    --Alfred Bester

IMN logo majestic logo threadwatch logo seochat tools logo