Topic: PHP Warning: PHP Startup: imap: Unable to initialize module Module

Hi, i'm facing the below issue.can any one help me out!!

PHP Warning:  PHP Startup: imap: Unable to initialize module
Module compiled with module API=20131226
PHP    compiled with module API=20100525

Re: PHP Warning: PHP Startup: imap: Unable to initialize module Module

which module ?
How was it installed ?

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: PHP Warning: PHP Startup: imap: Unable to initialize module Module

> PHP Warning:  PHP Startup: imap: Unable to initialize module
I haven't notice the "imap" in the message.

rpm -qa php\* | sort

You probably need to reinstall php-imap, as the installed module (for 5.4) is not compatible with the PHP 5.6 installed version (RPM API protection should deny such configuration, don't even know how this is possible, excepted with manually build extension, not managed by RPM)

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: PHP Warning: PHP Startup: imap: Unable to initialize module Module

Sorry for late reply, i'm getting this Warning message as i'm trying to seee imap module on RHEL 7 version

Re: PHP Warning: PHP Startup: imap: Unable to initialize module Module

Please answer my previous question, run:

rpm -qa php\* | sort

And paste the output.

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: PHP Warning: PHP Startup: imap: Unable to initialize module Module

php54-2.1-1.el7.remi.x86_64
php54-php-cli-5.4.45-1.el7.remi.x86_64
php54-php-common-5.4.45-1.el7.remi.x86_64
php54-php-pear-1.9.5-12.el7.remi.noarch
php54-php-process-5.4.45-1.el7.remi.x86_64
php54-php-xml-5.4.45-1.el7.remi.x86_64
php54-runtime-2.1-1.el7.remi.x86_64
php55-2.1-1.el7.remi.x86_64
php55-php-cli-5.5.29-1.el7.remi.x86_64
php55-php-common-5.5.29-1.el7.remi.x86_64
php55-php-pear-1.9.5-12.el7.remi.noarch
php55-php-pecl-jsonc-1.3.9-1.el7.remi.x86_64
php55-php-pecl-zip-1.13.1-1.el7.remi.x86_64
php55-php-process-5.5.29-1.el7.remi.x86_64
php55-php-xml-5.5.29-1.el7.remi.x86_64
php55-runtime-2.1-1.el7.remi.x86_64
php56-2.1-1.el7.remi.x86_64
php56-php-cli-5.6.13-1.el7.remi.x86_64
php56-php-common-5.6.13-1.el7.remi.x86_64
php56-php-pear-1.9.5-12.el7.remi.noarch
php56-php-pecl-jsonc-1.3.9-1.el7.remi.x86_64
php56-php-pecl-zip-1.13.1-1.el7.remi.x86_64
php56-php-process-5.6.13-1.el7.remi.x86_64
php56-php-xml-5.6.13-1.el7.remi.x86_64
php56-runtime-2.1-1.el7.remi.x86_64
php-common-5.6.13-1.el7.remi.x86_64
php-imap-5.6.13-1.el7.remi.x86_64
php-mcrypt-5.6.13-1.el7.remi.x86_64
php-pecl-jsonc-1.3.9-1.el7.remi.5.6.x86_64
php-pecl-zip-1.13.1-1.el7.remi.5.6.x86_64

Re: PHP Warning: PHP Startup: imap: Unable to initialize module Module

Don't know why you have installed php (base package) + php54 + php55 + php56 (SCL packages)

Which version(s) do you want ?
Do you need multiple versions ?
Which SAPI do you need (CLI ? Apache ? FPM ?)

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: PHP Warning: PHP Startup: imap: Unable to initialize module Module

Hey, just i need Php-Imap module.. dunno how all these packages came i mean php54,55 and 56 can you help me on this

Re: PHP Warning: PHP Startup: imap: Unable to initialize module Module

So you can probably:

yum remove php54\* php55\* php56\*

And then

yum-config-manager --enable remi-php56
yum install php-imap

But without any SAPI, I have huge doubt is will be useful...
So you probably also need to install php-cli (command line), php (mod_php for apache) or php-fpm (fastcgi server for apache, nginx, lighttp...)

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: PHP Warning: PHP Startup: imap: Unable to initialize module Module

[root@transformations ~]# php -m
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dom
ereg
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
ionCube Loader
json
libxml
mbstring
mcrypt
mysql
mysqli
mysqlnd
openssl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
Reflection
session
SimpleXML
soap
sockets
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlrpc
xmlwriter
xsl
zip
zlib

Unable to see imap here after performing the above steps

Re: PHP Warning: PHP Startup: imap: Unable to initialize module Module

which php
rpm -qf $(which php)
Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: PHP Warning: PHP Startup: imap: Unable to initialize module Module

[root@transformations ~]# which php
/usr/local/bin/php
[root@transformations ~]# ^C
[root@transformations ~]# rpm -qf
rpm: no arguments given for query
[root@transformations ~]# rpm -qf $(which php)
file /usr/local/bin/php is not owned by any package

Re: PHP Warning: PHP Startup: imap: Unable to initialize module Module

So you use a build from sources version.

yum --enablerepo=remi-php56 install php-cli php-imap
/usr/bin/php -v
/usr/bin/php -m
Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: PHP Warning: PHP Startup: imap: Unable to initialize module Module

[root@transformations ~]# /usr/bin/php -v
PHP 5.6.13 (cli) (built: Sep  3 2015 14:08:58)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
[root@transformations ~]# /usr/bin/php -m
[PHP Modules]
bz2
calendar
Core
ctype
curl
date
ereg
exif
fileinfo
filter
ftp
gettext
hash
iconv
imap
json
libxml
mcrypt
mhash
openssl
pcntl
pcre
Phar
readline
Reflection
session
sockets
SPL
standard
tokenizer
zip
zlib

[Zend Modules]

Hey!! now looks good.. we are able to see imap module here.. i think it's fix now.. am i correct ??

Re: PHP Warning: PHP Startup: imap: Unable to initialize module Module

walter wrote:

Hey!! now looks good.. we are able to see imap module here.. i think it's fix now.. am i correct ??

You probably need to clean up the content of the manual build version in /usr/local to avoid any further confusion.

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: PHP Warning: PHP Startup: imap: Unable to initialize module Module

Means can you guide me how to clean this

Re: PHP Warning: PHP Startup: imap: Unable to initialize module Module

See the "rm" command wink

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: PHP Warning: PHP Startup: imap: Unable to initialize module Module

but one question.. while executing php-m it doesn't showing me imap module but in /usr/local it showing me imap module.. is there anything to remove so that when ever i shoot php -m it will show

Re: PHP Warning: PHP Startup: imap: Unable to initialize module Module

Installed package put PHP in /usr/bin
You manually build version is in /usr/local/bin

"php -m" use the first version found (according to PATH order)

So "rm /usr/local/bin/php" (and probably some other stuff in /usr/local, but I can't know how much your system is messy)
And you will always use the packaged version, which can be extended if missing modules (yum install php-xxx) and will be updated on next version (yum update)

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: PHP Warning: PHP Startup: imap: Unable to initialize module Module

Thanks for your help buddy!!

Re: PHP Warning: PHP Startup: imap: Unable to initialize module Module

smile

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi