gpt4 book ai didi

php - 使用 CENTOS 在 PHP 上运行终端命令

转载 作者:太空宇宙 更新时间:2023-11-04 04:00:54 24 4
gpt4 key购买 nike

我不知道为什么下面的代码不起作用:

<?php shell_exec('pkill -x firefox') ?>

我没有在安全模式下运行 PHP,shell_exec 功能已启用,所以为什么我的 apache 不是 Killink firefox?

最佳答案

如果您不使用 apache 用户运行 firefox,则无法使用 apache 终止该进程。您必须以 root 身份运行 apache 才能访问系统中的所有进程。

警告:使用 root 权限运行任何公共(public)服务都会带来严重的安全风险。

关于php - 使用 CENTOS 在 PHP 上运行终端命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23050400/

24 4 0
文章推荐: linux - 如何在适用于 cPanel 或 CentOS 的 VPS 上安装 PDFTK?
文章推荐: html - Border-radius 和 box-shadow CSS 无法正常工作
文章推荐: linux - 在所有启动过程后运行我的应用程序
文章推荐: javascript -
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com