# compiling php with imap ldap mcal

## ergin

I tried to install horde (something like webmail) but

had a mod_php without having imap, ldap, mcal,xml. So I changed the use variable located in /etc/make.conf like this

```

USE="-gnome -X mysql innodb berkdb -kde -postgres -java -qt -qtmt -avi imap nls xml xml2 ldap mcal"

```

I emerged mod_php once again:

```

emerge dev-php/mod_php

ebuild ... config

```

after it I started the test application of horde which verifies the available modules. Result: imap,ldap,mcal is not available, but xml is working.  I looked at the compiling options of php with the phpinfo function. I cound't see any --with-imap or --with-ldap but --with-xml.

I saw that I had also installed php beside mod_php.  So I deinstalled php because I thought maybe php makes some problems to mod_php  :

```

emerge unmerge dev-php/php

```

But nothing changed.

My question: How can I have mod_php compiled with imap, ldap and mcal?

----------

## eivinn

To compile with imap, you must have uw-imap emerged or edit the ebuild yourself to include whatever imap-server your using. Don't know if it will work with other stuff than uw-imap though...

----------

## Caffeine

Anyone reading this ? I'm having the same problem. I added imap to my use variables, emerge mod_php, (which correctly installs uw-imap ) but php still says "call to undefined function" when I call imap_open(...);

Any ideas?

[Edit] Restarting apache didn't seem to do it, but rebooting did.  :Embarassed: 

----------

## pounard

I had and i have the same probleme, i didnt success in php with imap support installation

if anyone could help it would be nice

----------

## Robelix

I'm also trying to get Horde working...

imap and ldap seems to work "out of the box" if you have it in the USE flags, mcal is more complicated:

Get a libmcal ebuild at

https://bugs.gentoo.org/show_bug.cgi?id=14915

After emerging it edit the mod_php ebuild and add 

myconf="${myconf} --with-mcal=/usr"

to src_compile (somewhere before the ./configure, of course).

I hope it works, mod_php is still compiling while writing this, but I've got a promising "checking for MCAL support... yes"

The onyl problem left is the no longer existing PEAR-HTML_Select, but this is needed by Kronolith only.

Robelix

----------

## clar77

sorry to dig up an oldie, but did you ever get horde working ?

Ican log-in and view the calendar but when I try to add an event I get :

```

Warning: Unable to find stream pointer in /var/www/localhost/htdocs/horde/kronolith/lib/Driver/mcal.php on line 140

Warning: Unable to find stream pointer in /var/www/localhost/htdocs/horde/kronolith/lib/Driver/mcal.php on line 141

Warning: Unable to find stream pointer in /var/www/localhost/htdocs/horde/kronolith/lib/Driver/mcal.php on line 142

Warning: Unable to find stream pointer in /var/www/localhost/htdocs/horde/kronolith/lib/Driver/mcal.php on line 143

Warning: Unable to find stream pointer in /var/www/localhost/htdocs/horde/kronolith/lib/Driver/mcal.php on line 144

Warning: Unable to find stream pointer in /var/www/localhost/htdocs/horde/kronolith/lib/Driver/mcal.php on line 145

Warning: Unable to find stream pointer in /var/www/localhost/htdocs/horde/kronolith/lib/Driver/mcal.php on line 146

Warning: Unable to find stream pointer in /var/www/localhost/htdocs/horde/kronolith/lib/Driver/mcal.php on line 150

Warning: Unable to find stream pointer in /var/www/localhost/htdocs/horde/kronolith/lib/Driver/mcal.php on line 154

Warning: Unable to find stream pointer in /var/www/localhost/htdocs/horde/kronolith/lib/Driver/mcal.php on line 157

Warning: Unable to find stream pointer in /var/www/localhost/htdocs/horde/kronolith/lib/Driver/mcal.php on line 169

Warning: Unable to find stream pointer in /var/www/localhost/htdocs/horde/kronolith/lib/Driver/mcal.php on line 90

Warning: Cannot modify header information - headers already sent by (output started at /var/www/localhost/htdocs/horde/kronolith/lib/Driver/mcal.php:140) in /var/www/localhost/htdocs/horde/kronolith/addeventaction.php on line 21

```

??? Looks like an mcal problem, I guess and there's a few posts on the horde mail lists with the same problem but no answers there....  I used the libmcal in portage ? is that broken ?

----------

## ygreen

I just had the worst time trying to get mod_php to compile with imap support.  :Crying or Very sad:   Hopefully this follow up post will help anyone trying to get this same configuration working. I looked all over for a post that had the answer in it but kept coming up short. First I tried someones suggestion of emerging mod_php after net-mail/uw-imap and net-libs/c-client had been merged in but this by itself didn't work. Still I got messages about no imap support when compiling mod_php.

This was all in an effort to get horde-imp up and running that needs mod_php compiled with imap support built into it. The odd thing was setting my USE varables on the current console session with... 

```
#USE='imap'
```

...before running... 

```
#emerge -uv mod_php
```

...totally didn't work at all. Every time I tried it and watched the compiler output it would always get to the imap support detection part and list it with a definat 'no' every time.

What did work was setting all of my desired settings to my USE varable for that session:

```
USE="-X apache2 xml xml2 ssl imap ldap mysql php mod_php postfix uw-imap -x11 -xfree -gnome -gtk -ssmtp -kde libwww"
```

...and then running..

```
#USE=$USE emerge mod_php
```

This actually seemed to really perk portage up and get it rolling on compiling the dependencies, i.e. I had ldap in my USE variable and until now emerging mod_php did nothing about it. Passing it before the emerge argument got portage to merge in OpenLDAP before is merged mod_php and, correctly this time, adding in my much needed imap support. I was surprised as it never did this the previous times I tried merging it in even though it was in my USE.

Hope this helps someone else looking for the same answer.  :Laughing: 

----------

## mallchin

You would need to do 'export USE="imap" if your doing it like that, else do it all on one line like this 'USE="imap" emerge mod_php'.

----------

## martoni

Adding ldap and imap to /etc/make.conf, emerge uw-imap and openldap, and then reemerging mod_php works nicely for me.

Now I only have to fight my stupid non-standard mailserver.

----------

## mallchin

Anyone use horde-imp with dspam?

I noticed that imp stops rendering messages properly as dspam adds a signature like this !DSPAM:9873597987! at the end of all emails; I've tweaked the way dspam tags messages but they all cause imp some grief

Anyone else had this?

----------

