本帖最后由 飛貓 于 2022-3-16 16:30 编辑
请问如何让php执行linux命令 求大神指导最简易的方式
php的shell_exec 和exec和system禁用函数已经删除
目前我是利用访问getshell.php页面执行命令http://127.0.0.1/getshell.php?cmd=/etc/init.d/nginx%20restart
页面提示以下错误讯息
/etc/init.d/nginx restart
Fatal error: Uncaught Error: Call to undefined function shell_exec() in /www/wwwroot/127.0.0.1/getshell.php:5 Stack trace: #0 {main} thrown in /www/wwwroot/127.0.0.1/getshell.php on line 5
我设定getshell.php内容如下:
<?php
$get_cmd = $_GET["cmd"];
echo $get_cmd;
echo shell_exec($get_cmd);
?>
宝塔如何配置修改 请求大神如何解决???????
|
|