我的系統是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 -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 0
最后的解決思路:先下載php5.6.40包,解壓縮得到php-ldap5.6.40,上傳到服務器,解壓縮,准備環境
phpize
./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 details
解決方案,安裝gcc,yum install gcc
第二次:configure: error: Cannot find ldap.h
解決辦法:yum install openldap openldap-devel -y
第三次: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
至此問題解決!如果幫到了你,請留言讓我知道!