In PHP, exec always fails to call commands in the external EXE file.

Source: Internet
Author: User
Environment file, the file path has been added to the environment variable (or specify the exe file path) in PHP, through $ PHP, exec calls the commands in the external EXE file, always fails, please give advice
In PHP, exec always fails to call commands in the external EXE file.
One of the fossil.exe files has been added to the environment variable (or the path of the exe file)
In PHP
$ C = "fossil clone-A admin http: // admin: 92dd3f@192.168.2.22: 9090/cgi-bin/repo/95965728-994d-4d5d-9746-d84356f5b593". $ localRepositoryPath;
Exec ($ c, $ output, $ status );

First of all, the $ c command is correct, because it can be successfully executed under the cmd command line!
But in the execution result, $ status is always 1 (0 indicates success)

However, if I set $ c = "dir";, all files or directories in the current directory can be displayed.
You have tried the system method.
The pcntl_exec () method is not available in non-unix systems. I am confused!
Please give me some advice!
------ Solution --------------------
Browser access and terminal access are two permissions. The browser has common user permissions, and sudo (user operation permissions) is installed on the sub-host)
Then: exec ("sudo". $ c, $ output, $ status );
------ Solution --------------------
Reference: http://topic.csdn.net/u/20120619/12/b812046e-eeef-419b-9626-84d838615eb7.html
------ Solution --------------------
Do you need to participate in your fossil.exe execution?

------ Solution --------------------
What special functions are called? Some components must be authorized in DCOM.

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.