Home >Backend Development >PHP Problem >How to detect whether gd2 is installed in php

How to detect whether gd2 is installed in php

青灯夜游
青灯夜游Original
2021-09-26 14:13:033188browse

How to detect whether gd2 is installed in php: 1. Execute the "phpinfo();" code. If the "gd" module is included in the output PHP details, GD2 is installed. 2. Open the php installation directory ext folder, check if there is a "php_gd2.dll" file, if so, the GD2 library is installed.

How to detect whether gd2 is installed in php

The operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer

php detects whether gd2 Installation method

Method 1. Start phpinfo() to confirm the GD2 library. Start method:

Find the htdocs folder in the xampp directory , enter the folder to create a new file with the suffix .php, use the editor to enter the following code in .php:

<?php
    phpinfo();
?>

In the browser address bar, enter http://loaclhost:port (optional) /xxx (the above file name).php, and then enter, the page will display the detailed information of PHP. If you scroll down the page, you should be able to see the gd information, as shown in the figure below.

How to detect whether gd2 is installed in php

Method 2. Check if php comes with the gd2 library

Open the ext folder in the php installation directory and see Is there a php_gd2.dll file? If so, it means the GD2 library has been installed.

How to detect whether gd2 is installed in php

Recommended study: "PHP Video Tutorial"

The above is the detailed content of How to detect whether gd2 is 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