" and save the file and upload it to the server. Access the info.php file in the browser and find "Loaded Extensions" to query."/> " and save the file and upload it to the server. Access the info.php file in the browser and find "Loaded Extensions" to query.">
search
HomeBackend DevelopmentPHP ProblemHow to check which extensions are installed in php

You can check which extensions are installed in PHP through the command line, through the phpinfo() function and by checking the php.ini file. 1. Through the command line, use the "-m" option of the php command to query the installed extensions; 2. Through the phpinfo() function, create a file named info.php and enter "phpinfo();? >" and save the file and upload it to the server. Access the info.php file in the browser and find "Loaded Extensions" to query.

How to check which extensions are installed in php

The operating environment of this tutorial: windows10 system, php8.1.3 version, DELL G3 computer.

When using PHP to develop a website or application, we usually install some extensions to enhance the functionality and performance of PHP. However, it can get confusing when we need to determine which extensions are installed in the current PHP environment. Fortunately, PHP provides several methods to query installed extensions. This article will introduce three common methods: through the command line, through the phpinfo() function, and by checking the php.ini file.

1. Through the command line

Under the command line, we can use the "-m" option of the php command to query the installed extensions. Open a command line terminal, enter the following command and press Enter:

php -m

This will display all extensions installed in the current PHP environment.

2. Through the phpinfo() function

Another simple method is to use the phpinfo() function. Create a file called info.php and enter the following code in the file:

phpinfo();
?>

Save the file and upload it to your server. Then access the info.php file in your browser, and you will see a page with detailed information about the PHP environment. In this page, you can find "Loaded Extensions" (loaded extensions) section, which lists all extensions that have been installed.

3. Check the php.ini file

In some cases Next, we can also determine the installed extensions by checking the php.ini file. First, find the location of the php.ini file. Enter the following command in the command line terminal:

php --ini

This will display the current PHP environment The location of the php.ini file to use. Open the file and find the configuration related to the extension. In the php.ini file, the installed extensions will be listed and set to "extension=" line at the beginning.

The above are three common methods for querying installed PHP extensions. Each method is simple, and you can choose the method that suits you according to your actual needs to query installed extensions.

To summarize, understanding installed PHP extensions is very important for developing and maintaining PHP applications. Through the command line, the phpinfo() function, and checking the php.ini file, you can easily and quickly obtain a list of installed extensions to better understand and manage your PHP environment.

The above is the detailed content of How to check which extensions are installed in php. For more information, please follow other related articles on the PHP Chinese website!

Statement
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool