Home > Backend Development > PHP Problem > What are the php extensions?

What are the php extensions?

藏色散人
Release: 2023-02-23 09:00:02
Original
5570 people have browsed it

What are the php extensions?

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();
Copy after login

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();
Copy after login

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");
Copy after login

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
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template