get server ram with php

后端 未结 9 1640
抹茶落季
抹茶落季 2020-12-05 00:19

Is there a way to know the avaliable ram in a server (linux distro) with php (widthout using linux commands)?

edit: sorry, the objective is to be aware of the ram av

9条回答
  •  青春惊慌失措
    2020-12-05 00:45

    I don't remember having ever seen such a function -- its kind of out the scope of what PHP is made for, actually.

    Even if there was such a functionnality, it would probably be implemented in a way that would be specific to the underlying operating system, and wouldn't probably work on both Linux and windows (see sys_getloadavg for an example of that kind of thing)

提交回复
热议问题