dongzhucha3999 2015-06-15 17:30
浏览 531
已采纳

如何使用php在Centos OS上显示所有正在运行的进程?

So, my php code looks like this:

exec('ps aux', $out);

Running that on Ubuntu gives me a webpage with all running processes (all users), but on Centos OS 7 it shows only the processes of the 'apache' user. Is there any way I can fix that?

EDIT: Any way, I'm running it on a VM, it's just a school project.

sample output:

apache 8758 0.0.0.1 33052 7308 ? S S 03:50 0:00 /usr/sbin/httpd - DFOREGROUND
apache 1421 0.0.0.2 5128 2780 ? R 15:24 0:00 ps aux
  • 写回答

1条回答 默认 最新

  • duandu1966 2015-06-15 18:05
    关注

    The answer depends on a lot of stuff on the server side.

    More than likely what is happening is that your host is isolating your apache instances using CPU groups or similar. I would ask your host or the system admin why this is not working, but more than likely they'll just tell you they won't allow it. Allowing that sort of thing can have serious security implications.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?