能够configuration/编译PHP –with-ldap,但是LDAP不在phpinfo()中列出

我正在尝试使用这些行来编译支持LDAP的PHP:

./configure --prefix=/app/php --with-ldap=/usr sudo make sudo make install 

一切似乎安装正常没有问题,PHP运行良好,但是当我运行phpinfo,我没有看到LDAP列出。

另外,我读了一个地方,我可以在php的ext目录中使用ldap.so文件,并从php.ini引用它? 如何生成PHP的ldap.so文件…?

有任何想法吗? 我在Mac OS X 10.5.8,PHP 5.2.17。

更新:

我已经使用了这些标志的组合:

 --with-ldap --with-ldap=/usr --with-ldap=/usr,shared --with-ldap=shared 

其中,“–with-ldap = shared”生成一个ldap.so,当放在php的ext目录下时,在Apache中会出现这个错误:

 PHP Warning: PHP Startup: Invalid library (maybe not a PHP library) 'ldap.so' in Unknown on line 0 

我GOOGLE了这个错误,但没有find很多解决这个问题。 任何帮助apprecaited!

非常感谢!

KM

运行configure你需要查看config.log,以确保php正确地find了ldap。

没有什么可以放在php.ini 。 在只有--with-ldap而没有php.ini Linux机器上phpinfo会产生:

 ldap LDAP Support => enabled RCS Version => $Id: ldap.c 293036 2010-01-03 09:23:27Z sebastian $ Total Links => 0/unlimited API Version => 3001 Vendor Name => OpenLDAP Vendor Version => 20343 

如果你用ldap编译php,它将在ext目录下生成ldap.so文件,接下来你要做的就是通过php.ini(在phpinfo()页面findphp.ini文件的path)

;延长= php_ldap.so

取消注释此行以启用PHP的ldap模块

重新启动Apache并开始使用它..