The php command to execute the CMD command line cannot be connected ~ Use passthru to execute command lines to enable and disable services in a remote pc. Passthru (netuse \ 192.168.2.102 \ ipc $ & quot; 1 & quot; user: & quot; administrator & quot; & amp; SC \ 192.168.2.102stopmyS php cannot execute the CMD command line permission connection ~
Use passthru to execute command lines to enable and disable services in a remote pc.
Passthru ('Net use \ 192.168.2.102 \ ipc $ "1"/user: "administrator" & SC \ 192.168.2.102 stop myserver', $ s );
However, you do not have the administrator permission in actual use.
If the administrator fails to connect to server 2, an empty IPC link without a user name or password can be connected.
However, this command can be successfully executed directly in cmd. Why can't it be implemented in php?
------ Solution --------------------
First, check whether the php user has the permission to run the command.
------ Solution --------------------
The end of the world has long been around.
------ Solution --------------------
Put the server, WEB execution cannot operate on client drops
------ Solution --------------------
You can determine whether the disable_function in php. ini is disabled! There is also a problem with user permissions.
------ Solution --------------------
Can you execute php under your command?