What is a PHP extension?
Provide some extended functions for PHP
Common PHP extensions
mysql-----Provide PHP to operate MySQL database Features
gd2----Dynamic creation of images
xdebug-----Track, debug and analyze the running status of PHP programs
View PHP extensions
1. Use phpinfo probe
phpinfo()---Output information about PHP configuration
Output the current status of PHP A large amount of information, including PHP compilation options, enabled extensions, PHP version, server information and environment variables (if compiled as a module), PHP environment variables, operating system version information, path variables, local values of configuration options and main Value, HTTP header and PHP authorization information (license).
The above is PHP’s official explanation of the phpinfo() function. We will use this function to do a test.
First create a new file
<?php phpinfo();
Save and open this page in the browser, the browser will output the response information, including which PHP extensions we currently have enabled
2. Use get_loaded_extensions()
This function returns the names of all compiled and loaded modules in the PHP parser (both PHP extensions that have been enabled)
New The folder
<?php get_loaded_extensions();
will print and enter all loaded PHP extensions on the screen, returning the value as an array
3. Use the extension_loaded(string name) function
Function: Check whether an extension is loaded
For example, if we check whether redis is loaded, we can write like this
<?php extension_loaded("redis");
The return value is bool type, if it is loaded, it returns TRUE, otherwise it is FALSE
4. Command line mode to view which extensions are currently installed
php -m
The above is the detailed content of What are the php extensions?. For more information, please follow other related articles on the PHP Chinese website!