PHP如何指定ldap.conf位置? [英] PHP how to specify ldap.conf location?

查看:56
本文介绍了PHP如何指定ldap.conf位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个受ldap支持的PHP编译程序,它可以按预期工作.现在,我需要对SSL/TLS进行一些配置,但是我没有ldap.conf文件.

php -i说它是通过--ldap =/usr编译的,所以我想应该在/usr中创建ldap.conf文件,但是由于设备的体系结构限制,我在那里没有写许可. /p>

如何为php指定ldap.conf的路径?是否有php.ini设置?也许是命令行中的参数?

解决方案

请参见 ldap手册页:

用户可以在以下位置创建可选的配置文件ldaprc或.ldaprc. 他们的主目录,该目录将用于覆盖整个系统 默认文件.当前工作目录中的文件ldaprc也是 使用.

I have a PHP compiled with ldap support and it is working as expected. Now, I need to do some configuration for SSL/TLS but I have no ldap.conf file.

php -i says it was compiled --with-ldap=/usr so I suppose I should make the ldap.conf file in /usr, but I have no write permission there because of an architectural limitation of the device.

How can I specify the path to ldap.conf for php? Is there an php.ini setting? Maybe a parameter in command line?

解决方案

See http://de3.php.net/manual/en/function.ldap-connect.php#36156:

You also need to place those same settings in a file within the Apache Web user homedir called .ldaprc e.g.: cp /usr/local/openldap/etc/openldap/ldap.conf ~www/.ldaprc )

The apache web server root directory is the key here, as well as .ldaprc.

Also see the official ldap man pages:

Users may create an optional configuration file, ldaprc or .ldaprc, in their home directory which will be used to override the system-wide defaults file. The file ldaprc in the current working directory is also used.

这篇关于PHP如何指定ldap.conf位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆