search
HomeBackend DevelopmentPHP ProblemHow to install php ldap on centos

How to install php ldap on centos

Oct 19, 2021 am 10:43 AM
centos

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.

How to install php ldap on centos

##1

yum install PHP-ldap


Possible problems:

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

Solution:

Check the php version:

##1php -v##Search for ldap matching version:


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

yum search ldap


Reinstall:

1

##yum install php70w-ldap.x86 -64


How to install php ldap on centos</p><p></p><table class=


#Then open the ldap extension in php.ini:

1

2 12

vi /usr/local/php/lib/php.ini

extension=ldap.so


Completed, restart Apache2: service httpd restart.

3

/usr/local/ apache/bin/httpd -k restart4Total Links 0/unlimitedAPI Version 3001

// or this command

service httpd restart

After completion, check the info.php page, there will be ldap module, showing enabled.

##1

2

3

5

6

7

8

9

10

ldap

LDAP Support enabled

RCS Version $Id: 109508bbbecf73ca923b37138cbac56802f1231b $

Vendor Name OpenLDAP

Vendor Version 20440

SASL Support Enabled

Directive Local Value Master Value

ldap.max_links Unlimited Unlimited##1

##2. Compile and install

For the installation of LDAP, you must install it first
Check the following Has it been installed? If not:


Check:

2

yum list openldap1

yum list openldap-devel

Installation:

2

# yum install openldap# yum install openldap-devel


Be sure to execute this command:

1
# cp -frp /usr/lib64/libldap* /usr/lib/


Enter Under the installation directory
######1############ cd /root/lnmp1.0-full/php-5.2.17 /ext/ldap##################

(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


Restart apache

##1

2

3

##/usr/local/apache/bin/httpd -k restart

// or this command

service httpd restart

## Recommended study: "

PHP Video TutorialHow to install php ldap on centos

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!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Clair Obscur: Expedition 33 - How To Get Perfect Chroma Catalysts
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Safe Exam Browser

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

SublimeText3 English version

Recommended: Win version, supports code prompts!

MinGW - Minimalist GNU for Windows

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

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

Dreamweaver CS6

Visual web development tools