Home >Backend Development >PHP Problem >How to detect whether gd2 is installed in php
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.
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.
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.
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!