Does the first parameter of the EXEC function in PHP have to use an absolute path?

Source: Internet
Author: User
Title! Thank you! If you must have absolute path, how to solve!


Reply to discussion (solution)

Is the first parameter of the EXEC function not a command?

Is the first parameter of the EXEC function not a command?


This is the command. If the call is an EXE file, then this file must use absolute path?

Old Mao, this problem can be solved like this:
$relativePath = ' Path/program.exe ';
$absolutePath = Realpath (RelativePath);

Then you can use $absolutepath.

Old Mao said that he did not solve the problem, we continue to help ah, thank you.

Is there any answer to this question?

In just asking what to do with exec calling some commands to succeed, some not?

Whether an absolute path is required depends on whether the executed program is within the scope of the operating system search (path variable indicates)
Even within the search scope, there is no problem with absolute paths

The success of execution also has to consider the permissions issue, only anonymous users have the right to execute, it is possible to execute the success
In one is the parameter problem, when the parameter is the file name, it is best to use the absolute path. The relative path is relative to the execution of the program, the calculation is also more troublesome

The absolute path must be fine.
But system commands are not used under Windows
Linux under path indicates that the command is not used (in fact, it is usually placed in the directory of Path ...). )

The problem is solved. With//ip/path

  • 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.