First, if the source code is compiled
[Email protected] php-7.2. 7 ls /usr/local/php/lib/php/extensions/no-debug-non-zts-20170718/opcache.a opcache.so# An alarm occurs because the LDAP module does not exist and needs to be compiled to generate the module and reload
To the source package decompression directory, do not save the source files, download the same version of PHP decompression, source code compiled LDAP module (other modules if the same as the missing compilation method)
[Email protected] php-7.2.7]# cd/usr/src/php-7.2.7/ext/ldap/# Enter the source location of the module [[email protected] ldap]#lsconfig.m4 config.w32 CREDITS ldap.c ldap.mak ldap_win32_howto.txt php_ldap.h tests[[email protected] ldap]# /usr/local/php/bin/phpize # Tools for compiling PHP extensions, mainly generating corresponding configure files based on system information configuring for:P hp Api Version:20170718Zend Module Api No:20170718Zend Extension Api No:320170718[email protected] ldap]#./configure--with-php-config=/usr/local/php/bin/php-config--with-ldap && Make&& Make Install#配置 Compile and install
The following error may occur during execution
Configure:error:Cannot Find Ldap.h Workaround: yum -y
install
openldap openldap-devel
Configure:error:Cannot Find LDAP Libraries In/usr/lib workaround: cp
-frp
/usr/lib64/libldap
*
/usr/lib/
ls /usr/local/php/lib/php/extensions/no-debug-non-zts-20170718/opcache.a opcache.so /etc/php.ini # edit php.ini # found; extension=ldap line to remove, 5 version of PHP add extension=ldap.so
Save exit, restart Web service
If the module exists, modify the php.ini file directly
Second, if Yum is installed
Yum Install Php-ldap
Then restart the Web service
Source code when installing Zabbix PHP LDAP Warning