system - PHP shell_exec using UNC paths -


in php, can not execute command via shell_exec, system, or exec, when using unc paths. here example:

what works:

$command = shell_exec("dir c:\\"); echo $command; 

here not work. echo's nothing.

$command = shell_exec("dir \\\\server\\dir"); echo $command; 

when run dir \\server\dir in windows command window or powershell executes fine.

unc paths work, user php service running must have access share.

i assume running php iis. if case, default user iusr_machinename. sure user has access share.

if you're running apache, check task manager on server determine user running apache service. give user name access share.


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -