How to check whether Suhosin is installed?

不羁的心 提交于 2019-11-27 14:39:49
Mikhail Chernykh

To detect the Suhosin Extension use extension_loaded() no matter if it is dynamically loaded or statically compiled:

extension_loaded('suhosin');

To detect the Suhosin-Patch, check for the constant presence:

constant("SUHOSIN_PATCH");

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.

extension_loaded('suhosin');

PHP docs for extension_loaded.

If the extension doesn't load, it may still be available through dl:

if (!extension_loaded('suhosin')) {
    if (!dl('suhosin.so')) {
        // Extension not loaded.
        return false;
    }
}

// Extension loaded.
return true;

You can test if a configuration open is set for Suhosin:

$isSuhosinInstalled = ini_get('suhosin.session.max_id_length') !== '';
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!