I want to load an extension within a Php file as I don't have access to the php.ini file.
I tried:
ini_set('extension','php_gd2.dll');
With the file in the same directory as the Php page but it did not work.
Must it always be done with in php.ini or can it be done like the above?
if (!extension_loaded('php_gd2')) {
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
dl('php_gd2.dll');
} else {
dl('php_gd2.so');
}
}
But note that it won't work with all SAPIs; and is explicitly disabled when running in safe mode or PHP is built with zts support.