Functions such as phpsystem, exec, and shell_exec cannot run commands.

Source: Internet
Author: User
1. Check which user group your php uses: You can view the nginx configuration file or apache configuration file, such as etcnginxnginx. conf or etchttpdconfhttpd. conf. You can also use the following command :? Phpechoshell_exec (id-);? For example, if my User Group is apache, add ww to vimetcsudoer1.

1. Check which user group your php uses: You can view the nginx configuration file or apache configuration file, for example,/etc/nginx. conf or:/etc/httpd/conf/httpd. conf can also be used :? Php echo shell_exec ("id-");? For example, if my User Group is apache, add ww to vim/etc/sudoer 1.

1. Check which user group your php uses:
You can view the nginx configuration file or apache configuration file.
For example:/etc/nginx. conf or:/etc/httpd/conf/httpd. conf
You can also use:

 

For example, if my User Group is apache,
II,
Vim/etc/sudoer

1. Add www user www ALL = (ALL) NOPASSWD: ALL
2. Under vim/find LS_COLORS and remove it (this can be omitted without Ubuntu)
Comment out
Defaults requiretty
Defaults env_reset
These two sentences!

III,
Vim/etc/php. ini
Check:

Safe_mode = (if this is off, the two below will be ignored) disable_functions = safe_mode_exec_dir =

Done! Now you can run the linux Command in php!

Original article address: functions such as php system, exec, and shell_exec cannot run commands. Thank you for sharing it with me.

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.