# php5, ldap extension not found, phpldapadmin

## billmil

Hi,

I'm trying to get phpldapadmin running with PHP5, phpldapadmin, and apache2. I'm not a php-person so am a little fuzzy on mod_php, php4, php5, etc. As of this time (late 2006) PHP5 is stable and mod_php has been deprecated AFAIK.

I get this error when I run phpldapadmin from the browser:

 *Quote:*   

> Your install of PHP appears to be missing LDAP support. Please install LDAP support before using phpLDAPadmin. (Dont forget to restart your web server afterwards)

 

A look at the index.php script shows that this function returns false:

```

extension_loaded('ldap')

```

My use flag for PHP includes 'ldap'. (As does my use flag for apache, but I don't think that's relevant).

Versions of software: 

phpldapadmin: : 1.0.1 (afaik supports php5)

apache: 2.0.58-r2

php 5.1.6-r6

Here are use flags:

```

emerge -pv apache php phpldapadmin

These are the packages that would be merged, in order:

Calculating dependencies   ... done!

[ebuild   R   ] net-www/apache-2.0.58-r2  USE="apache2 ldap ssl -debug -doc -mpm-itk -mpm-leader -mpm-peruser -mpm-prefork -mpm-threadpool -mpm-worker (-selinux) -static-modules -threads" 0 kB 

[ebuild   R   ] dev-lang/php-5.1.6-r6  USE="apache2 berkdb cgi cli crypt gd gdbm iconv imap ipv6 ldap mysql ncurses nls pcre readline reflection sasl session spell spl ssl truetype xml zlib -adabas -apache -bcmath -birdstep -bzip2 -calendar -cdb -cjk -concurrentmodphp -ctype -curl -curlwrappers -db2 -dbase -dbmaker -debug -discard-path -doc -empress -empress-bcs -esoob -exif -fastbuild -fdftk -filepro -firebird -flatfile -force-cgi-redirect -frontbase -ftp -gd-external -gmp -hardenedphp -hash -hyperwave-api -informix -inifile -interbase -iodbc -java-external -kerberos -libedit -mcve -memlimit -mhash -ming -msql -mssql -mysqli -oci8 -oci8-instant-client -odbc -pcntl -pdo -pdo-external -pic -posix -postgres -qdbm -recode -sapdb -sharedext -sharedmem -simplexml -snmp -soap -sockets -solid -sqlite -sybase -sybase-ct -sysvipc -threads -tidy -tokenizer -unicode -vm-goto -vm-switch -wddx -xmlreader -xmlrpc -xmlwriter -xpm -xsl -yaz -zip" 0 kB 

[ebuild   R   ] net-nds/phpldapadmin-1.0.1  USE="-vhosts" 0 kB 

Total size of downloads: 0 kB

```

questions:

-what's this about php.ini ? Do I need to edit it (I thought portage would set that up for me. if so, which one)?

-any suggestions?

thanks in advance.

related posts:

https://forums.gentoo.org/viewtopic-t-126278-highlight-phpldapadmin+php+ldap+extension.html

https://forums.gentoo.org/viewtopic-t-246160-highlight-phpldapadmin+php5.html

----------

## moocha

```
ln -sf /etc/php/apache2-php5/ext/ldap.ini /etc/php/apache2-php5/ext-active/ldap.ini

/etc/init.d/apache2 restart
```

----------

## billmil

moocha wrote:

```
ln -sf /etc/php/apache2-php5/ext/ldap.ini /etc/php/apache2-php5/ext-active/ldap.ini

/etc/init.d/apache2 restart
```

Unfortunately my system lacks any ldap.ini. The following directory is empty:

```
/etc/php/apache2-php5/ext/
```

I did, however, solve the problem by running the following commands.

```

php-select php-cgi php5

php-select php-devel php5
```

It was set to 'php4' prior. Note that I didn't need to add/edit any '.ini' files

thanks,

bill m

----------

## moocha

Glad to hear you managed to solve it. Have fun  :Smile: 

----------

