CGI calls to Linux system commands

Source: Internet
Author: User

1. For example:
Create a directory: System ("mkdir Yourdir").
(1) First: To use the root user
If you want to use the root user in CGI, you must configure it in the boa.conf file and change the user nobody to user root;
After this change, will lead to Boa can not boot, see Error_log, prompted: "Boa.c:266.icky Linux kernel bug!:no such file", to solve this problem, only need to modify the BOA.C in the following lines of the decision to remove.
if (setuid (0)! =-1) {
Die ("Icky Linux kernel bug!");

(2) Second: To use absolute path
System ("/system/bin/mkdir Yourdir").

CGI calls to Linux system commands

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