The php that run on the webserver and the CLI version is not using the same php.ini file. If I do a command php --ini, it show this
I have spent about 3 hours trying to do exactly what your question asks. Couldn't do it. I gave up and copied that php.ini to C:\Windows and changed my ENV variable "PHPRC" to C:\Windows (and in httpd.conf). That way both my CLI php and Apach php e are using the same file. I could not get "php -m" to display the modules I had loaded in my php.ini for the life of me until I made this change...