個人系統是centos,php是yum的5.6.40,php-ldap也是yum的5.6.40,配置好ldap後,登陸時提示ERROR: PHP's 'ldap' extension is not installed/enabled. Please check your MRBS and web server configuration.php
先是查看系統日誌,或者php -m,提示:PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/ldap.so' - /usr/lib64/php/modules/ldap.so: cannot open shared object file: No such file or directory in Unknown on line 0html
最後的解決思路:先下載php5.6.40包,解壓縮獲得php-ldap5.6.40,上傳到服務器,解壓縮,準備環境web
phpizecentos
./configure服務器
這裏會報錯,報錯內容都在最後,第一次:日誌
configure: error: in `/root/php-5.6.4/ext/ldap':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more detailsserver
解決方案,安裝gcc,yum install gcchtm
第二次:configure: error: Cannot find ldap.hblog
解決辦法:yum install openldap openldap-devel -yio
第三次:configure: error: Cannot find ldap libraries in /usr/lib.
解決辦法:cp -frp /usr/lib64/libldap* /usr/lib/
而後繼續./configure,最後提示
config.status: creating config.h
config.status: executing libtool commands
一切正常,而後
make
make install
至此問題解決!若是幫到了你,請留言讓我知道!
原文出處:https://www.cnblogs.com/leelice/p/11069349.html