php使用root权限执行shell

来源:互联网 发布:收看全球电视直播软件 编辑:程序博客网 时间:2024/06/05 21:43

linux下:

编辑

/etc/sudoers  文件

//添加执行php的用户

lighttpd    ALL=(ALL)       NOPASSWD:ALL   #web(php执行) 用户



$parameter = '/usr/bin/sudo test.sh';

$res = exec($parameter,$arr);




原创粉丝点击