简体   繁体   English

PHP 检测 Litespeed

[英]PHP Detect Litespeed

I just did a server migration and asked the host to explicitly not install Litespeed.我刚刚进行了服务器迁移,并要求主机明确安装 Litespeed。

After discovering things not working I found Litespeed listed in the SAPI Modules of phpinfo() .在发现无法正常工作后,我发现 Litespeed 列在phpinfo()SAPI 模块中。

On my debug page I list various import bits of information to ensure that my server's configuration is correct and I need to ensure that Litespeed is not installed on the server before migrating clients.在我的调试页面上,我列出了各种导入信息,以确保我的服务器配置正确,并且我需要确保在迁移客户端之前在服务器上安装 Litespeed。

How do I detect Litespeed is installed on a server using PHP?如何使用 PHP 检测 Litespeed 是否安装在服务器上?

On my local server the substring count is 1 (listed though not loaded?) while on the live it's 2. This technically works:在我的本地服务器上,substring 计数为 1(虽然未加载但已列出?),而在现场为 2。这在技术上有效:

<?php
ob_start();
phpinfo();
$php_info = ob_get_contents();
ob_get_clean();

echo strpos($php_info, 'litespeed');
echo '<br />';
echo substr_count($php_info, 'litespeed');
?>

You can try the following:您可以尝试以下方法:

$output = shell_exec('cat /usr/local/lsws/VERSION');
echo "<pre>$output</pre>";

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

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