The process of installing and enabling PHP EXIF extensions in LNMP 2.1
1. Error report: call to undefined function common\models\exif_imageType error indicates that php cannot find the EXIF_IMAGETYPE function. EXIF_IMAGEType is a function in the EXIF extension of PHP to detect the type of image file. This error is caused if the extension is not installed or enabled.
2. In LNMP 2.1, install and enable the PHP EXIF extension process. Reference: Install php module/extension of lnmp (no need to reinstall php)
3. Check the extension_dir in phpinfo() to confirm The directory where the extension is located: /usr/local/php/lib/php/extensions/no-debug-non-zts-20190902. as shown in Figure 1
4. Enter the lnmp installation directory: by default, lnmp is installed in the /root/lnmp2.1 directory. Enter the directory, line the addons.sh script: install the EXIF extension using the following command: as shown in Figure 2
cd /root/lnmp2.1
./addons.sh install exif
5. Restart php-fpm: After the installation is complete, restart php-fpm to apply the changes:
[root@iZ2zeaj7tnbv8d3gsoy1w5Z lnmp2.1]# lnmp php-fpm restart
+-------------------------------------------+
| Manager for LNMP, Written by Licess |
+-------------------------------------------+
| https://lnmp.org |
+-------------------------------------------+
Gracefully shutting down php-fpm . done
Starting php-fpm done
[root@iZ2zeaj7tnbv8d3gsoy1w5Z lnmp2.1]#
6. Verify that the extension is enabled: check phpinfo() . Confirm that it is installed and enabled. as shown in Figure 3


