php exec: does not return output

前端 未结 10 1086
有刺的猬
有刺的猬 2020-12-01 17:20

I have this problem: On a ISS web server, windows 7 x64 professional, zend server installed. Running this command under php:

exec(\'dir\',$output, $err);
         


        
10条回答
  •  借酒劲吻你
    2020-12-01 17:59

    You can check permisssions of IIS User to cmd.exe

    cacls C:\WINDOWS\system32\cmd.exe
    

    If in output is line like (COMPUTERNAME=your computer name):

    C:\WINDOWS\system32\cmd.exe COMPUTERNAME\IUSR_COMPUTERNAME:N
    

    It means that user has no rights to execute cmd.

    You can add execute permissions with command:

    cacls C:\WINDOWS\system32\cmd.exe /E /G COMPUTERNAME\IUSR_COMPUTERNAME:R
    

提交回复
热议问题