I'm not familiar with Suhosin (never used it) but if possible I need to check using PHP whether it is installed. This is for part of an installer that I'm writing. Thanks.
我不熟悉Suhosin(从未使用它),但如果可能的话,我需要检查使用PHP是否已安装。这是我正在写的安装程序的一部分。谢谢。
4 个解决方案
#1
19
To detect the Suhosin Extension use extension_loaded() no matter if it is dynamically loaded or statically compiled:
要检测Suhosin扩展,请使用extension_loaded(),无论它是动态加载还是静态编译:
extension_loaded('suhosin');
To detect the Suhosin-Patch, check for the constant presence:
要检测Suhosin-Patch,请检查恒定存在:
constant("SUHOSIN_PATCH");
#2
6
simply write a php file in your document root like <?php phpinfo(); ?>
it will print all the information related to php installation just find for the "suhosin" block in it is installed on your server you can find the block with all the values set for it.
只需在文档根目录中编写一个php文件,如
#3
2
extension_loaded('suhosin');
PHP docs for extension_loaded
.
用于extension_loaded的PHP文档。
If the extension doesn't load, it may still be available through dl
:
如果扩展没有加载,它仍然可以通过dl获得:
if (!extension_loaded('suhosin')) {
if (!dl('suhosin.so')) {
// Extension not loaded.
return false;
}
}
// Extension loaded.
return true;
#4
2
You can test if a configuration open is set for Suhosin:
您可以测试是否为Suhosin设置了打开配置:
$isSuhosinInstalled = ini_get('suhosin.session.max_id_length') !== '';
#1
19
To detect the Suhosin Extension use extension_loaded() no matter if it is dynamically loaded or statically compiled:
要检测Suhosin扩展,请使用extension_loaded(),无论它是动态加载还是静态编译:
extension_loaded('suhosin');
To detect the Suhosin-Patch, check for the constant presence:
要检测Suhosin-Patch,请检查恒定存在:
constant("SUHOSIN_PATCH");
#2
6
simply write a php file in your document root like <?php phpinfo(); ?>
it will print all the information related to php installation just find for the "suhosin" block in it is installed on your server you can find the block with all the values set for it.
只需在文档根目录中编写一个php文件,如
#3
2
extension_loaded('suhosin');
PHP docs for extension_loaded
.
用于extension_loaded的PHP文档。
If the extension doesn't load, it may still be available through dl
:
如果扩展没有加载,它仍然可以通过dl获得:
if (!extension_loaded('suhosin')) {
if (!dl('suhosin.so')) {
// Extension not loaded.
return false;
}
}
// Extension loaded.
return true;
#4
2
You can test if a configuration open is set for Suhosin:
您可以测试是否为Suhosin设置了打开配置:
$isSuhosinInstalled = ini_get('suhosin.session.max_id_length') !== '';