问题
Is it possible to get extension version in php?
get_loaded_extensions returns only loaded extentions names, but not versions :(
回答1:
I believe this is what you're looking for:
$version = phpversion("extensionName");
More information
回答2:
At the command line, where extension is the extension name.
php --re extension | head -1
If unsure of the extension name, list extensions with php -m.
回答3:
http://php.net/manual/en/reflectionextension.getversion.php
<?php
$ext = new ReflectionExtension('mysqli');
var_dump($ext->getVersion());
?>
来源:https://stackoverflow.com/questions/14626262/retrieve-extension-version-in-php