How to install php ldap on centos: 1. Execute the "yum install PHP-ldap" command; 2. Open the ldap extension in php.ini; 3. Restart Apache2.
php -v |
yum search ldap |
##yum install php70w-ldap.x86 -64 |
#Then open the ldap extension in php.ini:
1
vi /usr/local/php/lib/php.ini extension=ldap.so |
| 1
3
// or this commandservice httpd restart
After completion, check the info.php page, there will be ldap module, showing enabled.
##1 2 3 | 4
5 LDAP Support enabled RCS Version $Id: 109508bbbecf73ca923b37138cbac56802f1231b $ | Total Links 0/unlimited
Vendor Name OpenLDAP
Vendor Version 20440
SASL Support Enabled
Directive Local Value Master Value
##2. Compile and installFor the installation of LDAP, you must install it first | Check the following Has it been installed? If not:
|
yum list openldap-devel |
Installation: |
|
# cp -frp /usr/lib64/libldap* /usr/lib/ |
|
(If you don’t know the installation directory, you can use find -name "php-*" to find it and find the directory of the corresponding version you installed)
Then run
1 2 3 4 5 6 7 8 9 |
# /usr/local/php/bin/phpize Configuring for: PHP Api Version: 20090626 Zend Module Api No: 20090626 Zend Extension Api No: 220090626 # ./configure --with-php- config=/usr/local/php/bin/php-config --with-ldap # make # make install Installing shared extensions: /usr/local /php/lib/php/extensions/no-debug-non-zts-20131226/ |
Generate such an extension, we enter the directory and put ldap.so is placed in the extensions directory:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
[root@openldap ldap]# make install Installing 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 -l total 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 -l total 176 -rwxr-xr-x 1 root root 173086 Jul 16 16:08 ldap.so drwxr-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 is not necessarily this directory, you can view it on the info.php page )
Add:
1 |
##extension=ldap.so |
2 3 ##/usr/local/apache/bin/httpd -k restart |
// or this command |
PHP Video Tutorial
The above is the detailed content of How to install php ldap on centos. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 English version
Recommended: Win version, supports code prompts!

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Dreamweaver CS6
Visual web development tools
