Suppose we have PHP installed on our machine and we want to quick check what extensions loaded on our PHP. Plus you just want to know through CLI. It's easy.
Usually I just type this.
php -i
It will display complete information about PHP and all its configuration. It is similar like we call phpinfo()
function.
The second is typing this command.
php -r "print_r(get_loaded_extensions());"
It will display loaded extensions only. The result example is like below.
Array
(
[0] => Core
[1] => date
[2] => libxml
[3] => openssl
[4] => pcre
[5] => zlib
[6] => filter
[7] => hash
[8] => pcntl
[9] => Reflection
[10] => SPL
[11] => sodium
[12] => session
[13] => standard
[14] => mysqlnd
[15] => PDO
[16] => xml
[17] => bcmath
[18] => calendar
[19] => ctype
[20] => curl
[21] => dom
[22] => mbstring
[23] => fileinfo
[24] => ftp
[25] => gd
[26] => gettext
[27] => iconv
[28] => igbinary
[29] => imap
[30] => json
[31] => exif
[32] => msgpack
[33] => mysqli
[34] => pdo_mysql
[35] => Phar
[36] => posix
[37] => readline
[38] => shmop
[39] => SimpleXML
[40] => sockets
[41] => sysvmsg
[42] => sysvsem
[43] => sysvshm
[44] => tokenizer
[45] => wddx
[46] => xmlreader
[47] => xmlwriter
[48] => xsl
[49] => memcached
[50] => Zend OPcache
)
Thank you and I hope you enjoy it.
Credits
- Cover image Pencil Shred by Pixabay from https://www.pexels.com/photo/cake-candy-celebration-chocolate-261738/
Top comments (0)