如何在 Ubuntu 服务器中使用 PHP 7.0 启用 LDAP?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/39786114/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 01:59:58  来源:igfitidea点击:

How to enable LDAP with PHP 7.0 in Ubuntu server?

phpldap

提问by Wings2fly

I have recently upgraded Ubuntu to version 16.04 and PHP to version 7. However, the ldap connection is not working.

我最近将 Ubuntu 升级到了 16.04 版,将 PHP 升级到了 7 版。但是,ldap 连接不起作用。

How to enable ldap in PHP 7?

如何在 PHP 7 中启用 ldap?

回答by NIDIA RAMIREZ

To install ldap on a lamp with PHP version 7.0 (or 7.1):

要在 PHP 7.0(或 7.1)版本的灯上安装 ldap:

  • apt-get install php7.0-ldap(or use apt-get install php7.1-ldap)
  • service apache2 restart
  • After that create a php file to get the php configuration phpinfo();
  • Now ldap is installed.
  • apt-get install php7.0-ldap(或使用apt-get install php7.1-ldap
  • service apache2 restart
  • 之后创建一个 php 文件以获取 php 配置 phpinfo();
  • 现在 ldap 已安装。

回答by COil

Providing the php version number is no more required:

不再需要提供 php 版本号:

apt-get install php-ldap

Is enough now, the correct package version will be automatically installed.

现在足够了,正确的软件包版本将被自动安装。

PS: Note that is it true if you use the standard php packages provided by your distribution. If you are using an additional ppa for PHP like the sury one, you will have to specify the version number as there are multiple versions available.

PS:请注意,如果您使用发行版提供的标准 php 包,这是真的。如果您正在为 PHP 使用额外的 ppa,如sury one,则必须指定版本号,因为有多个版本可用。