0

I'm very new when it comes to webservers. I have my own DDS but no imap installed at it. I asked my ISP to install it but they charge a lot. In my opinion it shouldn't be too much work so I started googling and came accross this article: http://www.electrictoolbox.com/install-php-imap-centos/.

It seems like i only have to execute 2 commands:

sudo yum install php-imap
sude /etc/init.d/httpd graceful

I'm logged on as user 'root' to my server, this is the account they provided to me. But when I try the first command I get this output:

[root@dds ~]# sudo yum install php-imap
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * addons: mirror.oxilion.nl
 * base: mirror.oxilion.nl
 * epel: ftp.nluug.nl
 * extras: mirror.oxilion.nl
 * rpmfusion-free-updates: mirror01.th.ifl.net
 * rpmfusion-free-updates-testing: mirror01.th.ifl.net
 * rpmfusion-nonfree-updates: mirror01.th.ifl.net
 * rpmfusion-nonfree-updates-testing: mirror01.th.ifl.net
 * updates: mirror.oxilion.nl
Excluding Packages in global exclude list
Finished
Setting up Install Process
No package php-imap available.
Nothing to do

How can I achieve to install php's imap functions?

I hope to hear from you!

Kind regards from Holland.

Ben Fransen

Update Output from less /etc/yum.conf (first about 20 empty lines)

[main]
cachedir=/var/cache/yum
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
distroverpkg=redhat-release
tolerant=1
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1

# Note: yum-RHN-plugin doesn't honor this.
metadata_expire=1h

installonly_limit = 5

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
exclude=apache* httpd* mod_* mysql* MySQL* da_* *ftp* exim* sendmail* php* bind-chroot*

** Update 2 ** Results from the commands you've provided.

[root@dds ~]# rpm -q php httpd
package php is not installed
package httpd is not installed
[root@dds ~]#
[root@dds ~]# rpm -V php httpd
package php is not installed
package httpd is not installed
[root@dds ~]#
Ben Fransen
  • 143
  • 1
  • 9
  • Hi Ben - your yum.conf is excluding all php* and httd* packages - if you comment-off that line, it should do the trick :) – warren Oct 14 '10 at 12:54
  • Hi Warren, i saw. Do you believe commenting that rule (however I can do that by CLI), then installing the package and then comment the line again would result in a different situation than I have now? (See my own answer). – Ben Fransen Oct 14 '10 at 13:00

3 Answers3

1

It's definitely there. Check your yum repository configurations in /etc/yum.{conf,repos.d} to make sure that the package hasn't been excluded for some reason.

Ignacio Vazquez-Abrams
  • 45,939
  • 6
  • 79
  • 84
  • When I try that command it tells me `-bash: /etc/yum.conf: Permission denied`. Any suggestions? – Ben Fransen Oct 14 '10 at 12:18
  • Open it in a text editor instead of trying to run it. – Ignacio Vazquez-Abrams Oct 14 '10 at 12:21
  • I don't believe I can do that? I'm logged on with putty... – Ben Fransen Oct 14 '10 at 12:23
  • `less /etc/yum.conf` – Ignacio Vazquez-Abrams Oct 14 '10 at 12:24
  • Updated my question with the output. Thanks so far man!, gave you +100 if i could ;) I think `php*` should be removed from this line huh? And if so, how can I accomplish that? – Ben Fransen Oct 14 '10 at 12:30
  • Those exclusions look like they're in there for a reason, possibly because those have been installed from source. Do `rpm -q php httpd` and `rpm -V php httpd` output anything? – Ignacio Vazquez-Abrams Oct 14 '10 at 12:35
  • I;ve added the outcome. – Ben Fransen Oct 14 '10 at 12:40
  • Okay, they've *definitely* been installed from source. Give up your current quest to install via yum, and find and reconfigure the source found somewhere on your system instead. – Ignacio Vazquez-Abrams Oct 14 '10 at 12:41
  • Thanks for your effort! Rosco's suggestion brought me a little further... – Ben Fransen Oct 14 '10 at 12:45
  • Rosco's solution may show some results, but you should **not** use it. At best it will have no effect; at worst it will **damage** your installation. – Ignacio Vazquez-Abrams Oct 14 '10 at 12:48
  • Ohw... that doesn't sound very good... What about the last comment I mande to Rosco's answer...? About the red-marked packages from `yum list installed`..? – Ben Fransen Oct 14 '10 at 12:49
  • I believe that red means that they're in the exclusion list, but you're using options to override it. – Ignacio Vazquez-Abrams Oct 14 '10 at 12:53
  • Hmm okay.. so it's 'installed' now.. but I still can't use it.. Any suggestions? Or am I going to have to contact my ISP so they can do this? – Ben Fransen Oct 14 '10 at 12:54
  • Would you happen to know who it was that put PHP on the system in the first place? – Ignacio Vazquez-Abrams Oct 14 '10 at 12:56
  • I'm pretty sure it's the ISP (they have employees which are specialized in these topics, ofcourse ;)) – Ben Fransen Oct 14 '10 at 12:59
  • Let's see just how specialized they are. Run `rpm -qa '*php*'`. – Ignacio Vazquez-Abrams Oct 14 '10 at 13:00
  • This outputs `[root@dds ~]# rpm -qa '*php*'`, 2nd line: `php-common-5.1.6-27.el5`, 3rd line: `php-imap-5.1.6-27.el5` – Ben Fransen Oct 14 '10 at 13:02
  • Not that specialized then. You'll have to find out if and where they left the PHP source code on the system from when they first built it. – Ignacio Vazquez-Abrams Oct 14 '10 at 13:04
  • Hehe, your asking me to lift a skycraper with my bare hands;) Is there a command which retrieves this information? – Ben Fransen Oct 14 '10 at 13:05
  • I'm pretty sure the ISP isn't going to charge you just to tell you where they left it, assuming they did. – Ignacio Vazquez-Abrams Oct 14 '10 at 13:07
  • Where does the answer on this question bring us? What do we need to do from there? – Ben Fransen Oct 14 '10 at 13:09
  • From there we need to run `./configure` with the appropriate options in that directory, then rebuild. – Ignacio Vazquez-Abrams Oct 14 '10 at 13:10
  • Okay! I'll ask them right away and I hope to get an answer on short notice. Thanks very much so far! When I have an answer I'll add another comment ;) – Ben Fransen Oct 14 '10 at 13:11
  • Could it be that de dir is `/etc/php.d/` ? – Ben Fransen Oct 14 '10 at 13:18
  • No, that's where the configuration for various PHP extensions is kept. – Ignacio Vazquez-Abrams Oct 14 '10 at 13:21
  • Okay, I've mailed my ISP. Waiting for an answer... – Ben Fransen Oct 14 '10 at 13:25
  • Okay, I have a reply: They told me I need to recompile PHP, its located in /usr/local/directadmin/custombuild. They also say I need to set some config options, then select the right version of IMAP and recompile. So, what's the gameplan Igniacio? ;) – Ben Fransen Oct 14 '10 at 14:29
  • First you'll need to install `libc-client-devel`. From there you'll need to run `./configure` with all the previous options plus `--with-imap`. I believe `config.log` should contain all the options used. If that succeeds then you'll need to run `make`, followed by `make install` as root. Restarting httpd should then bring it up with the IMAP module installed. Unfortunately I need to step out for a bit so I won't be able to do play-by-play from here on in. – Ignacio Vazquez-Abrams Oct 14 '10 at 15:19
  • Hi Ignacio! Thanks again for your reply and all your effort. My host finally did it and they didn't charge me for it after all. So it's working now. But it's damn handy people like you share your knowledge on forums like this! Thanks man, I'm sure we would have worked it out till it was working so i'm gladly accepting your answer! Thanks again, a lot! There aren't many people taking so much time to respond! Thanks again! Cheers! – Ben Fransen Oct 14 '10 at 17:31
  • By the way, they also mentioned not to use `--disableexcludes` because DirectAdmin, my adminpanel, is supposed to handle installs and therefore all these items were in the exclusionlist, another thing you were right about! :) – Ben Fransen Oct 14 '10 at 17:32
1

use this:

sudo yum install --disableexcludes=all php-imap

It's a one-shot command to install an RPM without modifying your exclusion list.

For the IMAP server itself I suggest dovecot which works fine for me with few extra configuration.

Rosco
  • 455
  • 3
  • 6
  • Thank you, +1 so far! I've posted the outcome in the result below.. – Ben Fransen Oct 14 '10 at 12:45
  • And by the way, I also called `yum list installed`, now php-imap is in that list, but marked red (also php-common), instead of gray/white (all others).. What does this mean? Did the restart fail? – Ben Fransen Oct 14 '10 at 12:48
  • from man yum.conf: color_list_installed_extra The colorization/highlighting for packages in list/info installed which has no available package with the same name and arch. Default is ‘bold,red’. – Rosco Oct 14 '10 at 13:09
0

@Rosco: I've tried your answer, at least php-imap got installed now! But I also called to restart the httpd-service but in my php file I stell get a message to an undefined function imap_open....

Output from the commands:

[root@dds ~]# sudo yum install --disableexcludes=all php-imap
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * addons: mirror.oxilion.nl
 * base: mirror.oxilion.nl
 * epel: ftp.nluug.nl
 * extras: mirror.oxilion.nl
 * rpmfusion-free-updates: mirror01.th.ifl.net
 * rpmfusion-free-updates-testing: mirror01.th.ifl.net
 * rpmfusion-nonfree-updates: mirror01.th.ifl.net
 * rpmfusion-nonfree-updates-testing: mirror01.th.ifl.net
 * updates: mirror.oxilion.nl
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-imap.x86_64 0:5.1.6-27.el5 set to be updated
--> Processing Dependency: php-common = 5.1.6-27.el5 for package: php-imap
--> Processing Dependency: libc-client.so.1()(64bit) for package: php-imap
--> Running transaction check
---> Package libc-client.x86_64 0:2004g-2.2.1 set to be updated
---> Package php-common.x86_64 0:5.1.6-27.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package              Arch            Version               Repository     Size
================================================================================
Installing:
 php-imap             x86_64          5.1.6-27.el5          base           54 k
Installing for dependencies:
 libc-client          x86_64          2004g-2.2.1           base          515 k
 php-common           x86_64          5.1.6-27.el5          base          153 k

Transaction Summary
================================================================================
Install       3 Package(s)
Upgrade       0 Package(s)

Total download size: 722 k
Is this ok [y/N]: y
Downloading Packages:
(1/3): php-imap-5.1.6-27.el5.x86_64.rpm                  |  54 kB     00:00
(2/3): php-common-5.1.6-27.el5.x86_64.rpm                | 153 kB     00:00
(3/3): libc-client-2004g-2.2.1.x86_64.rpm                | 515 kB     00:00
--------------------------------------------------------------------------------
Total                                           1.8 MB/s | 722 kB     00:00
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : php-common                                               1/3
  Installing     : libc-client                                              2/3
  Installing     : php-imap                                                 3/3

Installed:
  php-imap.x86_64 0:5.1.6-27.el5

Dependency Installed:
  libc-client.x86_64 0:2004g-2.2.1       php-common.x86_64 0:5.1.6-27.el5

Complete!
[root@dds ~]# sudo /etc/init.d/httpd graceful
Ben Fransen
  • 143
  • 1
  • 9