我正在使用 CentOS 7 在我的服务器上用 PHP 为套接字服务器创建服务。
我在使用 systemctl 命令启动和检索服务状态时遇到问题。
基本上,如果我运行:
system('systemctl status myservice');
我得到一个空白字符串。
我尝试使用“start”命令,但它没有启动任何东西。我还尝试过使用 httpd 等标准服务。
如果我从 SSH Shell 启动这些命令,一切正常。
我认为这不是 php 中禁用 shell 的问题,因为如果我运行
system("pwd");
我得到了正确的输出。所以shell是活跃的。
我能做些什么?