Forum Moderators: coopster

Message Too Old, No Replies

Getting imap_open to work

help me get this to work, i would be forever grateful

         

thejoker101

1:59 am on Jun 2, 2005 (gmt 0)

10+ Year Member



Ok, I'm running PHP5 on Suse 9.2. I've tried unsuccessfully for two days to get this to work.

When I recompile php with the --with-imap flag, it compiles just fine, but in the end, it still doesn't work. Has anyone successfully gotten this to work? If so, care to help me out here?

thejoker101

3:49 pm on Jun 2, 2005 (gmt 0)

10+ Year Member



I'm trying to compile php5 with the with-imap flag. As far as I can tell, everything is compiled fine and linked fine, but when I try to use, for example, imap_open(), I get an error that it isn't defined. I then check my phpinfo() and there is nothing in there about my imap version.

This is a link to my phpinfo:

This is a link to the output from when I built php:

This is a link to the output from when I built the imap c-client thing:

You'll note in the make output for php, it says it builds it just fine. Perhaps it's a problem with using cached copies of much of the files? I'm not sure how to force a compile of everything...

Any help would be great!

[edited by: jatar_k at 4:38 pm (utc) on June 2, 2005]
[edit reason] no urls thanks [/edit]

jatar_k

4:39 pm on Jun 2, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



>> it compiles just fine

>> it says it builds it just fine

these two things would make me think it is more of a code issue.

can you explain how it doesn't work? Are you gettings errors? Is it just not connecting?

thejoker101

4:48 pm on Jun 2, 2005 (gmt 0)

10+ Year Member



1) The imap module doesn't show up in my phpinfo

2) When i call imap_open(), I get this error, call to undefined function imap_open(), which means it can't find the module/library/whatever for it.

MattyMoose

5:06 pm on Jun 2, 2005 (gmt 0)

10+ Year Member



1) Did you restart apache after rebuilding php?
2) Did you include the extension in your configuration? (Don't think you have to do this if you build it --with-imap= )
3) what is in your "/usr/local/lib/php/20020429" directory? (I think that's the right path -- if not, it's the path where your PHP extensions/modules are)
4) If you find the modules, execute "ldd /path/to/imap.so" ( IIRC, you may need to use "ldd -r" in linux ) This will tell you what libraries it's looking for when it loads the imap module. If it says something like "libimap.so.5 => not found (0x0)", then you've got issues with your include paths, and library paths.

My money is on #1 though. ;)

MM

thejoker101

5:17 pm on Jun 2, 2005 (gmt 0)

10+ Year Member



1) Yes, multiple times.
2) I built php with this flag: --with-imap=/usr/local/imap-2004e.DEV.SNAP-0505252319. So, no.
3 / 4) AFAIK, there is no imap module, per se. You just build php with that flag and the accompanying c-client path. The imap module is for serverside image maps, not imap mail stuff.

If it matters, though I'm not sure if it does, I'm running php5 on Suse 9.2.

MattyMoose

5:37 pm on Jun 2, 2005 (gmt 0)

10+ Year Member



Interesting...

My guess then, would be that you have 2 versions of PHP installed. It could be that the PHP you're installing is going into another directory other than the one Apache is configured to look in. have a look at the omdule configuration, and see if the directories match, for where you expect it to be and where the "make install" is installing it to.

thejoker101

5:56 pm on Jun 2, 2005 (gmt 0)

10+ Year Member



Yes and no.

Because Suse doesn't release any rpm's for php5 on suse 9.2, I had to build it myself. I needed the nice object oriented stuff in php for a project I'm working on. Anyways, I found a site that gave me instructions on how to have both php4 and php5 installed. However, I never use php4 and never particularly care to.

Anyways, those instructions told me to compile my php, then copy the libphp5.so file to /usr/lib/apache2-prefork/. Then after that, in my /etc/sysconfig/apache2 file, where it lists the modules to load, change php4 to php5 (APACHE_MODULES="... php5") then just restart apache.

Now, perhaps I don't need to do all that. I'm not sure, I'm not really a server admin guru. I'm not a novice by any means either, but yeah, you get it.

Could I just do it the regular way doing the make and make install after I compile? Perhaps that would do it, I'm not sure. I'd hate to have to redo everything though.

MattyMoose

6:26 pm on Jun 2, 2005 (gmt 0)

10+ Year Member



Wow... so complex!

IMO, if you don't need php4 ever, then maybe remove the packages, undo the instructions that you followed and install php5 from source again, but this time doing a make install... The trick is to install everything where your SuSe distribution expects it to be. (--with-install-dir= and so on)

Then again, I've run into tremendous problems as soon as I have a single application that's built from source. What I mean is in binary package-based systems such as RedHat/SuSe, etc, if you build something from source, it's not typically added to the package database, so the package manager doesn't know it's installed. It will complain next time that you want to install a package that depends on what you installed from source, since it won't know it's there... The option in that case is either to force the installation, or to build a package from the source "make". There may be instructions on how to do this floating around somewhere.

That's about as much as I can help, I think. I haven't used a package-based linux distribution in a long time, this being one of the reasons.

HTH,
MM