The php command to execute the CMD command line cannot be connected ~ Solution

Source: Internet
Author: User
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: & quo php does not have the upper limit for the permission connection to execute the CMD command line ~
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?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.