Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Retrieve extension version in php

Is it possible to get extension version in php?

get_loaded_extensions returns only loaded extentions names, but not versions :(

like image 328
avasin Avatar asked Jan 31 '13 12:01

avasin


People also ask

How do you find out what PHP extensions are installed?

The general command we will be using is php -m. This command will give you the full list of installed PHP modules/extensions.

How can I find my PHP version?

1. Type the following command, replacing [location] with the path to your PHP installation. 2. Typing php -v now shows the PHP version installed on your Windows system.

How do I know what PHP extensions are installed on Windows?

PHP extensions are usually called "php_*. dll" (where the star represents the name of the extension) and they are located under the "PHP\ext" folder.


2 Answers

I believe this is what you're looking for:

$version = phpversion("extensionName");

More information

like image 189
EM-Creations Avatar answered Sep 22 '22 02:09

EM-Creations


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.

like image 30
Quolonel Questions Avatar answered Sep 22 '22 02:09

Quolonel Questions