How to enable LDAP extension for PHP in Ubuntu
Solution 1
sudo apt-get install php-ldap
/etc/init.d/apache2 restart
@baig772 answered their own question but they didn't post it as an answer.
Solution 2
you need to restart your apache (systemctl restart apache2
). Apache has its very own single php-process running*. The php-configuration is only reload if apache restarts this process. You can check your active configuration with phpinfo
* this is very simplified and depends on the apache MPM-Module you are using.
baig772
For the past 12+ years, I have been working in the industry, leading the way into what are now well-known technologies. For the past 6 years, I have been building and heading a team focused on Agile Development Practices using the Accelerate Strategies, as well as modern technologies and workflows such as Laravel, AWS ECS, AWS Serverless. Lambda, Elastic Search, ReactJS, VueJS, Continuous Integration and Deployment and more. During those years, I have led numerous releases of projects with teams ranging from just me to 20+ people. My most recent work has allowed the team to perform at elite levels. Each project pushes the technology stack we use, the skills of the team, and the possibilities of the Web Applications that we can create.
Updated on June 17, 2022Comments
-
baig772 almost 2 years
I am trying to enable
LDAP
forPHP5.6
onUbuntu 16.04
. I have tried the following steps- sudo apt-get install php5-ldap - sudo enmod ldap - sudo php5enmod ldap
but still I am unable to get my ldap related functions working with PHP
-
Rathan Naik over 6 yearsAre you getting any errors ?
-
baig772 over 6 yearsYes,
Fatal Error: Call to an undefined function ldap_connect
-
baig772 over 6 yearsYes,
Fatal Error: Call to an undefined function ldap_connect
-
Rathan Naik over 6 yearsDoes
sudo apt-get install php5-ldap
install successfully ? @baig772 -
baig772 over 6 yearsit said unable to locate php5-ldap but i did
sudo apt-get install php-ldap
and it worked -
Rathan Naik over 6 yearsDid you restart apache ?
/etc/init.d/apache2 restart
-
baig772 over 6 yearsLet us continue this discussion in chat.
-
CodeConnoisseur over 4 yearsI ran sudo apt-get install php5.6-ldap to get it for a specific php version then restarted apache and it worked (Ubuntu 18.04)
-
-
baig772 over 6 yearsI think this should be in comments sections. It is quite obvious that one always restarts the
apache
whenever apache or php related installation is done -
blaimi over 6 yearsOT: I'm currently collecting reputation points by answering questions to get the 'comment everywhere'-permission …