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.