简体   繁体   English

获取PHP中的服务器屏幕分辨率

[英]Get server screen resolution in PHP

I am wondering if anybody knows of any function available to get the screen resolution of a monitor connected to a server in PHP. 我想知道是否有人知道可用任何功能来获得用PHP连接到服务器的监视器的屏幕分辨率。

I do NOT want the resolution of any client computer. 我不希望任何客户端计算机的分辨率。 I am looking to put together some basic information about a few servers that I can get access to intermittently through a PHP script running on the Apache servers and one of the important pieces of information is the screen resolution. 我正在寻找一些有关一些服务器的基本信息,我可以通过运行在Apache服务器上的PHP脚本来间歇地访问这些服务器,其中重要的信息之一就是屏幕分辨率。

The only way I can think of that might work is executing an actual terminal command with exec , get the result and find the resolution in it. 我能想到的唯一可行的方法是使用exec执行实际的终端命令,获取结果并在其中找到解决方案。 But please be aware of the dangers of exec and read the "Warning" section. 但是请注意exec的危险,并阅读“警告”部分。

You properly need the correct permission to execute this kind of commands. 您正确地需要正确的权限才能执行这种命令。 So it depends on the type of server, operating system, etc. if this works. 因此,如果可行,则取决于服务器,操作系统等的类型。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM