How to check whether Suhosin is installed?

Mike picture Mike · Aug 2, 2010 · Viewed 18.1k times · Source

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.

Answer

Mikhail Chernykh picture Mikhail Chernykh · Aug 2, 2010

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");