In PHP, exec calls the command in the external EXE file, always fails, asks

Source: Internet
Author: User
In PHP, exec calls the command in an external EXE file, always fails, and asks the Master for guidance.
In PHP, exec calls the command in an external EXE file, always fails, and asks the Master for guidance.
One of the Fossil.exe files, the file path has been added to the environment variable (or specify the exe file path)
In PHP, the
$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);

The first thing to be sure is that there is no problem with the $c command, because under the cmd command line, you can do it successfully!
But in the result of execution, $status is always 1 (0 indicates success)

But I put $c= "dir"; you can display all files or directories in the current directory
And the system method, and I tried, no.
Pcntl_exec () method is said to be non-UNIX system without this method, I faint dish ah!
Seek expert guidance Ah!
------Solution--------------------
Browser access and access under the terminal are two permissions. The browser is the normal user rights, the machine is loaded sudo (User operation rights)
Then: exec ("sudo". $c, $output, $status);
------Solution--------------------
Reference: http://topic.csdn.net/u/20120619/12/b812046e-eeef-419b-9626-84d838615eb7.html
------Solution--------------------
Does your fossil.exe require user involvement when executing?

------Solution--------------------
What special features are called? Some components require authorization in DCOM.
  • Related Article

    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.