Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How php installs ldap extensions

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article focuses on "how to install ldap extensions in php". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "how php installs ldap extensions".

Php installs the ldap extension: 1, install the ldap extension online through "yum install PHP-ldap"; 2, put "ldap.so" in the extensions directory.

This article operating environment: centOS6.8 system, PHP7.0 version, DELL G3 computer

How does php install the ldap extension?

Install PHP ldap extension under Centos

There are two ways to install PHP ldap extension under Centos, for reference only.

I. online installation

Execute the following command:

Yum install PHP-ldap

Possible problems:

Error: php70w-common-.. Conflicts with php-common-5.4.... It means version conflict.

Solution:

View the version of php:

Php-v

Search for ldap with a matching version:

Yum search ldap

Find a matching version installation (mine is php70w-ldap.x86-64)

Reinstall:

Yum install php70w-ldap.x86-64

I will lose a y halfway to make sure.

Then open the ldap extension in php.ini:

Vi / usr/local/php/lib/php.iniextension=ldap.so

Complete, restart Apache2:service httpd restart.

/ usr/local/apache/bin/httpd-k restart// or this command service httpd restart

When you are finished, look at the info.php page and there will be a module for ldap, which will display enabled.

LdapLDAP Support enabledRCS Version $Id: 109508bbbecf73ca923b37138cbac56802f1231b $Total Links 0/unlimitedAPI Version 3001Vendor Name OpenLDAPVendor Version 20440SASL Support EnabledDirective Local Value Master Valueldap.max_links Unlimited Unlimited II. Compile and install

For LDAP installation, you have to install it first.

Check to see if the following is installed, if not:

Check:

Yum list openldapyum list openldap-devel installation: # yum install openldap# yum install openldap-devel must execute this command: # cp-frp / usr/lib64/libldap* / usr/lib/ enter the installation directory # cd / root/lnmp1.0-full/php-5.2.17/ext/ldap (those who do not know the installation directory can use find-name "php-*" to find Find the directory of the corresponding version you installed) and run # / usr/local/php/bin/phpizeConfiguring for:PHP Api Version: 20090626Zend Module Api No: 20090626Zend Extension Api No: 22009062 with-ldap# make# make installInstalling shared extensions. / configure-- with-php-config=/usr/local/php/bin/php-config-- with-ldap# make# make installInstalling shared extensions: / usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/

To generate such an extension, we go to that directory and place ldap.so in the extensions directory:

[root@openldap ldap] # make installInstalling shared extensions: / usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/ [root@openldap ldap] # cd / usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/ [root@openldap no-debug-non-zts-20131226] # ls-ltotal 748-rwxr-xr-x 1 root root 173086 Jul 16 16:05 ldap.so-rwxr-xr-x 1 root root 586024 Jul 16 12: 04 opcache.so [root@openldap no-debug-non-zts-20131226] # cp ldap.so / usr/local/php/lib/php/extensions/ldap.so [root@openldap no-debug-non-zts-20131226] # cd. [root@openldap extensions] # ls-ltotal 176-rwxr-xr-x 1 root root 173086 Jul 16 16:08 ldap.sodrwxr-xr-x 2 root root 4096 Jul 16 16:05 no-debug-non-zts-20131226 [root@openldap extensions] #

Modify vi / usr/local/php/etc/php.ini (your php configuration file, not necessarily this directory, can be viewed on the info.php page)

Add:

Extension=ldap.so

Restart apache

/ usr/local/apache/bin/httpd-k restart// or this command service httpd restart

At this point, I believe you have a deeper understanding of "how php installs ldap extensions". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report