The Ldap Extension Of Your Php Parser Isn T Installed

Active6 years, 10 months ago

The php_ldap.dll is in teh C: PHP ext directory so I don't see what the problem is. I have also restarted the web server after making changes to the.ini file. How would I fixed the issue? I had glpi install on windows 2003 server and un-comment extension = php_ldap.dll. Php.ini file location was under c: windows. Ldap_explode_dn turns unprintable chars (in the ASCII sense, UTF8. PHP don't support the ldap functions ldap_str2dn and. Php /** * Parse, and format a DN. LDAP Auth on WAMP [closed]. In your php.ini file. I didn't notice the LDAP extension was installed on the box I've been using. OCI client from Oracle distributes un ldap.h which may collision with the SO ldap.h. You can, remove the Oracle ldap.h and build or configure php without oci8 and then add OCI8 later as a shared extension.

I'm trying to write some LDAP authentication code on my WAMP server.

I'm using this:

I'm getting this error:

Fatal error: Call to undefined function ldap_connect() in C:Program FilesApache Software FoundationApache2.2htdocsoplwebindex.php on line 10

From some basic Googling, it looks like I need to turn on mod_ldap. Seems simple. I've done the following:

  • Went to C:Program FilesApacheSoftware FoundationApache2.2modulesand made sure that mod_ldap.soexists.
  • I've gone into C:ProgramFilesApache SoftwareFoundationApache2.2confhttpd.confand made sure that this line is notcommented out: LoadModule ldap_modulemodules/mod_ldap.so
  • I've gone intoC:Program FilesPHPphp.ini and madesure this line is not commented out:extension=php_ldap.dll
  • Restart apache

The problem still persists. Does the ldap_connect() function in php have any other dependencies? Am I missing a step?

Cheers

Cory Dee
Cory DeeCory Dee
1,9656 gold badges30 silver badges52 bronze badges

closed as off topic by kapa, oers, skolima, Florent, occulusOct 26 '12 at 12:57

Questions on Stack Overflow are expected to relate to programming within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here. If this question can be reworded to fit the rules in the help center, please edit the question.

5 Answers

I ran into this same issue with my Windows Server 2008 - Have you added the php.ini file to your windows path?

Go to Control Panel and open the System icon (Start -> Settings -> Control Panel -> System, or just Start -> Control Panel -> System for Windows XP/2003+)

Go to the Advanced tab

Click on the 'Environment Variables' button

Look into the 'System Variables' pane

Find the Path entry (you may need to scroll to find it)

Double click on the Path entry

Enter your PHP directory at the end, including ';' before (e.g. ;C:php)

Press OK

SlukehartSlukehart

Check your phpinfo to make sure ldap is enabled. You should see an LDAP section, and

Support enabled

You may have php set to auto-enable anything in your extension dir, or you may have to manually enable it by uncommenting a line that looks like:

extension=php_ldap.dll

in your php.ini file

Remember to restart apache after you enable it.

dobriendobrien

If you're connecting to an Active Directory, you can use this class which doesn't require any special PHP extension: http://sourceforge.net/projects/adldap/

CapsuleCapsule
5,7371 gold badge15 silver badges27 bronze badges

for WAMP, the working version of php.ini is located at apachebin.i was experienced same problem before until i change php.ini setting inside apachebin and finally it works.

MIchaelMIchael

I ran into the same problem recently and I searched for php.ini on my disk and found that there are two php.ini files there -- one under the php directory and the other under the apachebin directory. I uncommented the extension=php_ldap.dll line in both files and the problem is solved.

The ldap extension of your php parser isn t installed buildingPigueiras
15.6k8 gold badges52 silver badges81 bronze badges
fulinyunfulinyun

Not the answer you're looking for? Browse other questions tagged phpwindowsapacheldapwamp or ask your own question.

Active1 year, 5 months ago

When attempting to use ldap_connect(), I get this error:

Fatal error: Call to undefined function ldap_connect()

I've recompiled php with the LDAP apache module enabled, and I've edited my php.ini file, too and uncommented:

I'm on Red Hat Linux, php 5.3.10, apache 2.2. Any ideas?

Loaded Apache Modules: (contains *util_ldap*)

core mod_authn_file mod_authn_default mod_authz_host mod_authz_groupfile mod_authz_user mod_authz_default mod_auth_basic mod_include mod_filter util_ldap mod_log_config mod_logio mod_env mod_expires mod_headers mod_setenvif mod_version mod_proxy mod_proxy_connect mod_proxy_ftp mod_proxy_http mod_proxy_scgi mod_proxy_ajp mod_proxy_balancer mod_ssl prefork http_core mod_mime mod_status mod_autoindex mod_asis mod_info mod_suexec mod_cgi mod_negotiation mod_dir mod_actions mod_userdir mod_alias mod_rewrite mod_so mod_auth_passthrough mod_bwlimited mod_fpcgid mod_php5 mod_security

Apache Protocols: (contains: ldap)

dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtsp, smtp, smtps, telnet, tftp

hakre
164k33 gold badges323 silver badges637 bronze badges
Citizen

The Ldap Extension Of Your Php Parser Isn T Installed Updates

Citizen
4,90516 gold badges53 silver badges86 bronze badges

4 Answers

You write:

When attempting to use ldap_connect(), I get this error:

Fatal error: Call to undefined function ldap_connect()

You get this error because the function ldap_connect­Docs is not defined. You can not call an undefined function in PHP, that's why you see the fatal error.

To get that function defined, you need to load a PHP module/extension called LDAP. It comes with installation intructions. You wrote:

I've recompiled php with the LDAP apache module enabled.

If you recompile PHP, ensure you enable LDAP, see:

You will need to use the --with-ldap[=DIR] configuration option when compiling PHP to enable LDAP support. DIR is the LDAP base install directory.

However, normally it's enough to just install what you need via the package manager, e.g. try:

QTP is a commercial tool and trial version can be downloaded from HP site directly. Only the current version which is Unified functional testing(11.5x) is available for download. Qtp 11 free download hp. Complete Guide to download and install QTP - Trial / Free / Paid version. QTP 11 is now available for download. HP has packaged QTP 11. Wilma to run Qtp right click on qtp icon and open using run as admin then only u can access qtp. This way u can use qtp for 30 days free without any license. Wilma on September 12, 2011 at 13:51 Hi.

If it's not enough and you actually need to edit your PHP configuration (not always necessary), do it:

I hope this is helpful. Take care that .dll is windows only.

hakrehakre
164k33 gold badges323 silver badges637 bronze badges

I would strongly recommend you use the PHP that you can install using yum. Depending on your RH version, you may have to specify that you want php53 (for RH < 6). So, do the install like this:

  1. yum install php53
  2. yum install php53-ldap

At this point, you should be good to go. You do not need to have any special Apache LDAP library installed at all to get PHP to work with LDAP.

The Ldap Extension Of Your Php Parser Isn T Installed

If you are using RH 6, then you can skip the 53 part of the name.

Lucas RockwellLucas Rockwell

This is mostly a hunch, but have you tried downgrading to PHP 5.3.9?

There's a small amount of buzz on the internet about LDAP being broken on 5.3.10. Also, could try PHP 5.4 if you felt daring.

hakre

The Ldap Extension Of Your Php Parser Isn T Installed Programs

164k33 gold badges323 silver badges637 bronze badges
Thomas SchultzThomas Schultz
1,8012 gold badges21 silver badges33 bronze badges

For CentOs. I have installed Php 7.So when I tried to execute

there was this error

To solve this error and install ldap-php, execute

The server will be trying to install 5.6 But we need to guide the server to install with 7.

If it is not working try adding the extension in php.ini which is mentioned in the other answer.

The Ldap Extension Of Your Php Parser Isn T Installed Building

And don't forgot to restart the server.

Once the installation is done, the ldap-login will be done successfully.

The Ldap Extension Of Your Php Parser Isn T Installed Synonym

Pravinraj VenkatachalamPravinraj Venkatachalam

Not the answer you're looking for? Browse other questions tagged phpapacheredhatopenldap or ask your own question.