php7.2安装ldap扩展模块

安装使用php

   [下载php7.2.13](http://php.net/downloads.php)
 编译安装
 ./configure' '--prefix=/usr/local/php' '--with-config-file-path=/usr/local/php/etc' '--with-config-file-scan-dir=/usr/local/php/etc/php.d' '--with-fpm-user=www' '--with-fpm-group=www' '--enable-fpm' '--enable-opcache' '--disable-fileinfo' '--enable-mysqlnd' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--with-iconv-dir=/usr/local' '--with-freetype-dir' '--with-jpeg-dir' '--with-png-dir' '--with-zlib' '--with-libxml-dir=/usr' '--enable-xml' '--disable-rpath' '--enable-bcmath' '--enable-shmop' '--enable-exif' '--enable-sysvsem' '--enable-inline-optimization' '--with-curl=/usr/local/curl' '--enable-mbregex' '--enable-mbstring' '--with-password-argon2' '--with-sodium=/usr/local' '--with-gd' '--with-openssl=/usr/local/openssl' '--with-mhash' '--enable-pcntl' '--enable-sockets' '--with-xmlrpc' '--enable-ftp' '--enable-intl' '--with-xsl' '--with-gettext' '--enable-zip' '--enable-soap' '--disable-debug'
 make  -j 4&& make install

安装ldap扩展模块

先安装openldap

[root@mha-master ]# yum install openlda
[root@mha-master ]# yum install openldap-devel    

如果你是64位,请拷贝相关文件,或创建软链

[root@mha-master ]# ln -sv  /usr/lib64/libldap* /usr/lib/ 

然后进入PHP对应版的源码

 [root@mha-master ext]# pwd
     /lnmp/src/php-7.2.13/ext

切换到ldap目录

 [root@mha-master ext ]# cd ldap/
 [root@mha-master ldap ]#  /usr/local/php/bin/phpize
 [root@mha-master ldap ]# ./configure --with-php-config=/usr/local/php/bin/php-config
 [root@mha-master ldap ]# make && make install

最后在php.ini中添加扩展文件

 [root@mha-master ldap]# vim /usr/local/php/etc/php.ini
        extension=ldap.so
#### 重启php 使用 php -m查看模块
 [root@mha-master ldap]# php -m

php7.2安装ldap扩展模块

猜你喜欢

转载自blog.51cto.com/9025736/2347618