Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run php extensions at runtime

Tags:

php

I'm trying to load a php extension at runtime. As the use of dl() is discouraged and it is removed from PHP i'm using php extension directives but it doesn't work either.

ini_set('extension','php_gmp.dll');

if(extension_loaded( 'gmp' ))
    echo 'GMP is Loaded';

Is it possible to do it ?

The reason why i want to do it is that my application needs gmp and want to load gmp even if gmp is not running on the web server.

Thanks


1 Answers

It is not possible to load extensions via ini_set. The extension directive is only changable in php.ini as described in the Path and Directories section.

like image 75
Oswald Avatar answered Apr 17 '26 01:04

Oswald