简体   繁体   English

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

[英]How to enable LDAP with PHP 7.0 in Ubuntu server?

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?

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

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

install both php ldap for your specific php version, mine was为您的特定 php 版本安装两个 php ldap,我的是

sudo apt install php7.2-ldap php-ldap -y

it solves the problem i was having它解决了我遇到的问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM