Question: I can't use the `ldap_connect` function but I checked in php.ini and it's in.

I didn't find this error on Internet. Everyone is having "Call to undefined function" but I got "Attempted" and can't figure why.

I checked with `function_exists('ldap_connect')` and it was false.

I use Symfony2, apache and PHP 5.5.9.

I call the function from my controller and I get the parameters from parameters.yml :

```
$ldap_user = $this->container->getParameter('ldap_user');
$ldap_pass= $this->container->getParameter('ldap_pass');
$ldap_co = ldap_connect($this->container->getParameter('ldap_address'));

```

If someone could help me that would be awesome.

Thanks in advance.

Answer: 
I think I find the answer. It was an apache2 issue.

I went in `/etc/apache2/mods-available` to check if `ldap.conf` and `ldap.load` were in, and they were. Then I checked in `/etc/apache2/mods-enabled` in which they were not. And that's the problem.

So I ran the following command : `sudo a2enmod ldap` in order to activate the ldap module for apache2. Then `sudo service apache2 reload` and in the instant I saw it enabled in `phpinfo()`.

Maybe that's not the correct way to do it, if anyone have a better answer I'll take it.
You need to enable `ldap` extension to php. To do that (paths are from Ubuntu) add symbolic link `/etc/php5/apache2/conf.d` 

```
lrwxrwxrwx 1 root root   31 Sep 23  2014 20-ldap.ini -> ../../mods-available/ldap.ini

```

(similar to `/etc/php5/cli/conf.d` if you want to have this available in `cli`)

Check [doc](http://php.net/manual/en/ldap.installation.php) for more info