You are executing the check script via command line, so the php.ini is different between the CLI and apache.For find the correct php.ini for the cli lauch the following command:
php -i | grep 'php.ini'
And check the Loaded Configuration File
line
Hope this help