In linux, php executes the external shell script system and returns 126

Source: Internet
Author: User
{Code...} the first $ command is your own shell script to compress the folder of the second parameter to the path of the third file. Let's talk about the current situation. The security mode is not enabled for 1php. ini. you can call commands such as ls normally. 2system returns 126, ex...

  =================
';print_r($out);?>

The first $ command is your own shell script to compress the folder of the second parameter to the path of the third file. Let's talk about the current situation.
1. php. ini has no security mode enabled. you can call commands such as ls normally.
2 system returns 126 when executing this command, and the second exec parameter is null.
3. the html directory 777 permission is granted to the generated file, and the compressed test directory is also the 777 permission.
4. run this command using the command line.

Is there any configuration required to execute such a custom script ??

Reply content:

  =================
';print_r($out);?>

The first $ command is your own shell script to compress the folder of the second parameter to the path of the third file. Let's talk about the current situation.
1. php. ini has no security mode enabled. you can call commands such as ls normally.
2 system returns 126 when executing this command, and the second exec parameter is null.
3. the html directory 777 permission is granted to the generated file, and the compressed test directory is also the 777 permission.
4. run this command using the command line.

Is there any configuration required to execute such a custom script ??

The execution was finally blocked by selinux, leaving a result for your reference. The result is that the script can be executed normally in php-cli mode, and 126 is returned by executing the script on the webpage with sudo and 1 is returned.

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.