rebuilding php with imap support under cPanel

zosorock

Member
Sep 12, 2006
16
0
151
Hi all,

I have a box that came with cPanel installed on EV1 servers. Since the first day, horde webmail did not work supposely because there is no imap support on PHP but that didn't bother me as there were still two webmails to choose from. But now I have another application that needs IMAP and I am running into a little trouble:

I need to rebuild PHP with IMAP support. I know I need to rebuild it with --with-imap=/location/of/imap but I am not sure where that would be in a cPanel installation. Is it a shared installation? Do you I need to provide the path to the binary? to the sources? any idea where that would be?

Also, I don't want to upgrade PHP (currently running 4.3.10), just to be on the safe side and maintain all the applications currently hosted on my server running. I don't want to get 20 calls from clients saying their applications crashed because I upgraded PHP :D

Can anyone give me any pointers, links, hints or help me in any way? It is all much appreciated.

I am not a very skilled server admin but I try my best :eek:

Thanks in advance!

Fabiano
 

dalem

Well-Known Member
PartnerNOC
Oct 24, 2003
2,977
152
368
SLC
cPanel Access Level
DataCenter Provider
cpanels install of horde does not use the servers php (ev1 was lying to you) cpanel runs its own ver of php


to upgrade php use apache update in WHM or from the command line use /scripts/easyapache

if you need to compile the IMAP module into php select it going from php 4.3.10 to 4.4.4 should not hurt anything


php 4.3.10 is not secure
 

zosorock

Member
Sep 12, 2006
16
0
151
Thank for your reply Dalem!

Following your advise I went ahead and upgraded PHP via WHM. It went smoothtly BUT it did not install imap support, even with me checking the option. This is the build config screen as I had configured it to be built:



This is the result I got from it:

Code:
Apache Build/Upgrade

Main >> Software >> Apache Update
Building Apache Config.....Done
Downloading and compiling apache+modules....

Verifying archive integrity... All good.
Uncompressing buildapache......................................................................................................................................................................................................................................
Checking Update System......../etc/rc.d/init.d/httpd start: httpd started
Setting /home permissions to 0711......Done
Setting permissions for.....xxxx...xxxx...xxxx...xxxx...xxxx...xxxx...xxxx...xxxx...xxxx...xxxx...xxxx...xxxx......Done
Fetching http://httpupdate.cpanel.net/buildapache/1/php-4.4.4.tar.gz (0)[email protected]%...2%...3%...4%...5%...6%...7%...8%...9%...10%...11%...12%...13%...14%...15%...16%...17%...18%...19%...20%...21%...22%...23%...24%...25%...26%...27%...28%...29%...30%...31%...32%...33%...34%...35%...36%...37%...38%...39%...40%...41%...42%...43%...44%...45%...46%...47%...48%...49%...50%...51%...52%...53%...54%...55%...56%...57%...58%...59%...60%...61%...62%...63%...64%...65%...66%...67%...68%...69%...70%...71%...72%...73%...74%...75%...76%...77%...78%...79%...80%...81%...82%...83%...84%...85%...86%...87%...88%...89%...90%...91%...92%...93%...94%...95%...96%...97%...98%...99%...100%......Done
Untarring php....Done
Applying CURL curl_formfree patch
patching file ext/curl/curl.c
Hunk #1 succeeded at 724 (offset 179 lines).
Hunk #2 succeeded at 913 (offset 28 lines).
Running configure:
LDFLAGS="-L/usr/X11R6/lib64" /home/cpapachebuild/buildapache/callbacklog --prog configure --dir /home/cpapachebuild/buildapache/build-log --  --with-apxs=/usr/local/apache/bin/apxs  --prefix=/usr/local --with-xml    --enable-bcmath --enable-calendar  --enable-ftp  --enable-magic-quotes  --with-mysql=/usr  --enable-discard-path  --with-pear  --enable-sockets --enable-track-vars --with-zlib 

[b]./configure [@php-4.4.4]...(--with-apxs=/usr/local/apache/bin/apxs --prefix=/usr/local --with-xml --enable-bcmath --enable-calendar --enable-ftp --enable-magic-quotes --with-mysql=/usr --enable-discard-path --with-pear --enable-sockets --enable-track-vars --with-zlib)[/b].... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Done

make [@php-4.4.4]...(-j 1 clean).... Done

make [@php-4.4.4]...(-j 1).... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Done

make [@php-4.4.4]...(install).... . . . . . . . . . . . . . . . . . . . . . Done

/etc/rc.d/init.d/httpd start: httpd started

./configure [@php-4.4.4]...(--prefix=/usr --with-xml --enable-bcmath --enable-calendar --enable-ftp --enable-magic-quotes --with-mysql=/usr --enable-discard-path --with-pear --enable-sockets --enable-track-vars --with-zlib).... . . . . . . . . . . . . . . . . . . . . . . Done

make [@php-4.4.4]...(-j 1 clean).... Done

make [@php-4.4.4]...(-j 1).... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Done

make [@php-4.4.4]...(install).... . . . . . . . . . . . . . . . . . . . . Done

initfpsuexec: using apache 1.x support
PHP version file has been updated to 4.4.4
Executing /scripts/postbuildapache (if exists)...Done
/etc/rc.d/init.d/httpd start: httpd started
    
Attempting to restart httpd 	

Waiting for httpd to restart....
.
.
.
.
.
.
.
.
.
.
finished.

httpd status

root     32500  1.0  1.0  8296 5172 ?        S    21:04   0:00 /usr/local/apache/bin/httpd -DSSL

httpd started ok

Build Complete
If you notice the configure options, it does not include "--with-imap"... any suggestions on how to do this "by hand"?

Thanks a million!

Fabiano
 

zosorock

Member
Sep 12, 2006
16
0
151
Did it!

In case anyone runs into the same problem, in which cPanel won't rebuild PHP with IMAP support, the shell command that I used to make it work was (from the cpanel/apache/php build folder):

./configure --with-apxs=/usr/local/apache/bin/apxs --prefix=/usr/local --with-xml --enable-bcmath --enable-calendar --enable-ftp --enable-magic-quotes --with-mysql=/usr --enable-discard-path --with-pear --enable-sockets --enable-track-vars --with-zlib --with-imap=/usr/local --with-kerberos --with-imap-ssl
 

villario

Registered
Dec 10, 2006
4
0
151
with GD

./configure [@php-4.4.4]...(--enable-pic --with-apxs=/usr/local/apache/bin/apxs --with-libdir=lib64 --prefix=/usr/local --with-xml --enable-bcmath --enable-calendar --enable-ftp --with-gd --with-jpeg-dir=/usr/local --with-png-dir=/usr --with-xpm-dir=/usr/X11R6 --with-imap=/usr/local/imap-2004g --enable-magic-quotes --with-mysqli --with-mysql=/usr --with-openssl --enable-discard-path --with-pear --enable-sockets --enable-track-vars --with-ttf --with-freetype-dir=/usr --enable-gd-native-ttf --with-zlib)

./configure [@php-4.4.4]...(--enable-pic --with-libdir=lib64 --prefix=/usr --with-xml --enable-bcmath --enable-calendar --enable-ftp --with-gd --with-jpeg-dir=/usr/local --with-png-dir=/usr --with-xpm-dir=/usr/X11R6 --with-imap=/usr/local/imap-2004g --enable-magic-quotes --with-mysqli --with-mysql=/usr --with-openssl --enable-discard-path --with-pear --enable-sockets --enable-track-vars --with-ttf --with-freetype-dir=/usr --enable-gd-native-ttf --with-zlib)....

Both of these are performed by Apache Update. Maybe best to compile these two into one or run both of them separately?