PHP Warning: Module imap.so and xmlrpc.so

staff

Verified User
Joined
Sep 19, 2007
Messages
118
Location
France
Hello,

I have several cron tasks to create and I receive by email the summary but I receive errors :

PHP Warning: Module 'imap' already loaded in Unknown on line 0
PHP Warning: Module 'xmlrpc' already loaded in Unknown on line 0
Incorrect key

I run the command "php -info | grep configure" here is the result :

PHP Warning: Module 'imap' already loaded in Unknown on line 0
PHP Warning: Module 'xmlrpc' already loaded in Unknown on line 0
Configure Command => './configure' '--enable-embed' '--prefix=/usr/local/php73' '--program-suffix=73' '--enable-fpm' '--with-fpm-systemd' '--with-litespeed' '--with-config-file-scan-dir=/usr/local/php73/lib/php.conf.d' '--with-curl' '--with-gd' '--with-gettext' '--with-jpeg-dir=/usr/local/lib' '--with-freetype-dir=/usr/local/lib' '--with-libxml-dir=/usr/local/lib' '--with-kerberos' '--with-openssl' '--with-imap=/usr/local/imap-2007f' '--with-imap-ssl' '--with-mhash' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-mysqli=mysqlnd' '--with-pcre-regex=/usr/local' '--with-pdo-mysql=mysqlnd' '--with-pear' '--with-png-dir=/usr/local/lib' '--with-sodium=/usr/local' '--with-webp-dir=/usr/local/lib' '--with-xmlrpc' '--with-xsl' '--with-zlib' '--enable-zip' '--without-libzip' '--with-iconv=/usr/local' '--enable-bcmath' '--enable-calendar' '--enable-exif' '--enable-ftp' '--enable-sockets' '--enable-soap' '--enable-mbstring' '--with-icu-dir=/usr/local/icu' '--enable-intl'
ionCube24 features => unconfigured

Thank you for your answers ;)
 
Check to see if you have manually added these modules to a php.ini file somewhere. This typically happens when a system will enable a module in the php.ini file for you (a system like DA's CustomBuild, cPanel's EasyApache, or even Pecl), but without knowing this, a client will go manually edit the php.ini file and specify where to load the module.so file from. This can result in PHP trying to load the module twice, and thus the error you are seeing.

Try this:

Code:
/usr/local/directadmin/custombuild/build used_configs

Now:

Code:
grep -i "imap\|xmlrpc"  /path/to/php.ini

Also, check any .user.ini or php.ini files you have in your site's path (/home/USER/domains/DOMAIN/public_html/):

Code:
grep -i "imap\|xmlrpc"  /home/USER/domains/DOMAIN/public_html/*.ini
 
Thank you for your response so I run:

/usr/local/directadmin/custombuild/build used_configs

Result:

Apache configuration file: /usr/local/directadmin/custombuild/configure/ap2/configure.apache
Nginx (reverse proxy) configuration file: /usr/local/directadmin/custombuild/configure/nginx_reverse/configure.nginx
PHP (default) php.ini file: /usr/local/php73/lib/php.ini
PHP (additional) php.ini file: /usr/local/php72/lib/php.ini
PHP (additional, 3rd) php.ini file: /usr/local/php71/lib/php.ini
PHP (additional, 4th) php.ini file: /usr/local/php70/lib/php.ini
PHP (default) configuration file: /usr/local/directadmin/custombuild/custom/php/configure.php73
PHP (additional) configuration file: /usr/local/directadmin/custombuild/custom/php/configure.php72
PHP (additional, 3rd) configuration file: /usr/local/directadmin/custombuild/custom/php/configure.php71
PHP (additional, 4th) configuration file: /usr/local/directadmin/custombuild/custom/php/configure.php70
PureFTPD configuration file: /usr/local/directadmin/custombuild/configure/pureftpd/configure.pureftpd
Exim Makefile: https://files-fr.directadmin.com/services/custombuild/Makefile
Dovecot configuration file: /usr/local/directadmin/custombuild/configure/dovecot/configure.dovecot
phpMyAdmin configuration file:

Result of grep -i "imap\|xmlrpc" /usr/local/php73/lib/php.ini :

; http://php.net/xmlrpc-errors
;xmlrpc_errors = 0
;xmlrpc_error_number = 0
;extension=imap
;extension=xmlrpc
[imap]
; enable them. Note that the IMAP library does not filter mailbox names before
;imap.enable_insecure_rsh=0

The last command grep -i "imap\|xmlrpc" /home/ashkael/domains/doctor-pc.fr/public_html/*.ini tells me that no file exists
 
The following may point to other ini files loaded that you can check:

Code:
 /usr/local/php73/bin/php -ini  | grep -i "ini\|Configuration" | grep -v Classes


Also, do you have any custom PHP modifications?

Code:
ls /usr/local/directadmin/custombuild/configure/php/custom/
 
command result /usr/local/php73/bin/php -ini | grep -i "ini\|Configuration" | grep -v Classes :

PHP Warning: PHP Startup: Invalid library (maybe not a PHP library) 'imap.so' in Unknown on line 0
PHP Warning: PHP Startup: Invalid library (maybe not a PHP library) 'xmlrpc.so' in Unknown on line 0
Configuration File (php.ini) Path => /usr/local/php73/lib
Loaded Configuration File => /usr/local/php73/lib/php.ini
Scan this dir for additional .ini files => /usr/local/php73/lib/php.conf.d
Additional .ini files parsed => /usr/local/php73/lib/php.conf.d/10-directadmin.ini,
/usr/local/php73/lib/php.conf.d/50-webapps.ini
Configuration
user_ini.cache_ttl => 300 => 300
user_ini.filename => .user.ini => .user.ini
ic24.sec.initial_action => block => block
ic24.sec.initial_cache_all => 1 => 1
ic24.sec.initial_notify => always => always
ic24.sec.initial_state => 1 => 1
init_command_executed_count => 0
init_command_failed_count => 0
com_init_db => 0
open sourced by => Epinions.com

Yes I made custom php modifications here for version 7.3 of PHP

#!/bin/sh
./configure --enable-embed \
--prefix=/usr/local/php73 \
--program-suffix=73 \
--enable-fpm \
--with-fpm-systemd \
--with-litespeed \
--with-config-file-scan-dir=/usr/local/php73/lib/php.conf.d \
--with-curl \
--with-gd \
--with-gettext \
--with-jpeg-dir=/usr/local/lib \
--with-freetype-dir=/usr/local/lib \
--with-libxml-dir=/usr/local/lib \
--with-kerberos \
--with-openssl --with-imap=/usr/local/imap-2007f --with-imap-ssl \
--with-mhash \
--with-mysql-sock=/var/lib/mysql/mysql.sock \
--with-mysqli=mysqlnd \
--with-pcre-regex=/usr/local \
--with-pdo-mysql=mysqlnd \
--with-pear \
--with-png-dir=/usr/local/lib \
--with-sodium=/usr/local \
--with-webp-dir=/usr/local/lib \
--with-xmlrpc \
--with-xsl \
--with-zlib \
--enable-zip \
--without-libzip \
--with-iconv=/usr/local \
--enable-bcmath \
--enable-calendar \
--enable-exif \
--enable-ftp \
--enable-sockets \
--enable-soap \
--enable-mbstring \
--with-icu-dir=/usr/local/icu \
--enable-intl

if I remove the 2 modules in my personalized configuration file, will they no longer be loaded?
 
Last edited:
Hello,

I just installed xmlrpc and imap both into my DA server using the CustomBuild commands and haven't gotten the errors.

How did you install these modules? Did you manually add them to the configure.php73 file, or did use the build commands?

I used the following commands:

Code:
/usr/local/directadmin/custombuild/build php_imap
/usr/local/directadmin/custombuild/build php_xmlrpc

This resulted in no error, no mention of either module in configure.php73 file, and both modules enabled:

Code:
[root@host html]# grep -i "xmlrpc\|imap" /usr/local/directadmin/custombuild/configure/php/configure.php73
[root@host html]# /usr/local/php73/bin/php -m | grep -i "xmlrpc\|imap"
imap
xmlrpc
[root@host html]#
 
Hello ;)

I went through the custombuild commands from my DA for the installation and I manually add the xmlrpc module to the custom file.

But it seems to me that I have this error since I went from openlitespeed to Apache + Nginx

results :

[root@srv1 custombuild]# grep -i "xmlrpc\|imap" /usr/local/directadmin/custombuild/configure/php/configure.php73
[root@srv1 custombuild]# /usr/local/php73/bin/php -m | grep -i "xmlrpc\|imap"
PHP Warning: Module 'imap' already loaded in Unknown on line 0
PHP Warning: Module 'xmlrpc' already loaded in Unknown on line 0
imap
xmlrpc
[root@srv1 custombuild]#

my custom files can be found here: /usr/local/directadmin/custombuild/custom/ it's normal ? it shouldn't be here: /usr/local/directadmin/custombuild/configure/php/custom/
 
Last edited:
I deleted the custom folder and recompile php and I no longer have errors

[root@srv1 custombuild]# grep -i "xmlrpc\|imap" /usr/local/directadmin/custombuild/configure/php/configure.php73
[root@srv1 custombuild]# /usr/local/php73/bin/php -m | grep -i "xmlrpc\|imap"
imap
xmlrpc
[root@srv1 custombuild]#

Thanks for your help ;)
 
Hello i have the same thing
/usr/local/directadmin/custombuild/custom/php/configure.php73
Code:
#!/bin/sh
./configure --enable-embed \
        --prefix=/usr/local/php73 \
        --program-suffix=73 \
        --enable-fpm \
        --with-fpm-systemd \
        --with-litespeed \
        --with-config-file-scan-dir=/usr/local/php73/lib/php.conf.d \
        --with-curl \
        --with-gd \
        --with-gettext \
        --with-jpeg-dir=/usr/local/lib \
        --with-freetype-dir=/usr/local/lib \
        --with-libxml-dir=/usr/local/lib \
        --with-kerberos \
        --with-openssl --with-imap=/usr/local/imap-2007f --with-imap-ssl \
        --with-mhash \
        --with-mysql-sock=/var/lib/mysql/mysql.sock \
        --with-mysqli=mysqlnd \
        --with-pcre-regex=/usr/local \
        --with-pdo-mysql=mysqlnd \
        --with-pear \
        --with-png-dir=/usr/local/lib \
        --with-sodium=/usr/local \
        --with-webp-dir=/usr/local/lib \
        --with-xsl \
        --with-zlib \
        --enable-zip \
        --without-libzip \
        --with-iconv=/usr/local \
        --enable-bcmath \
        --enable-calendar \
        --enable-exif \
        --enable-ftp \
        --enable-sockets \
        --enable-soap \
        --enable-mbstring \
        --with-icu-dir=/usr/local/icu \
        --enable-intl

and for 72 the same file
Code:
#!/bin/sh
./configure --enable-embed \
        --prefix=/usr/local/php72 \
        --program-suffix=72 \
        --enable-fpm \
        --with-fpm-systemd \
        --with-litespeed \
        --with-config-file-scan-dir=/usr/local/php72/lib/php.conf.d \
        --with-curl \
        --with-gd \
        --with-gettext \
        --with-jpeg-dir=/usr/local/lib \
        --with-freetype-dir=/usr/local/lib \
        --with-libxml-dir=/usr/local/lib \
        --with-kerberos \
        --with-openssl --with-imap=/usr/local/imap-2007f --with-imap-ssl \
        --with-mhash \
        --with-mysql-sock=/var/lib/mysql/mysql.sock \
        --with-mysqli=mysqlnd \
        --with-pcre-regex=/usr/local \
        --with-pdo-mysql=mysqlnd \
        --with-pear \
        --with-png-dir=/usr/local/lib \
        --with-sodium=/usr/local \
        --with-webp-dir=/usr/local/lib \
        --with-xsl \
        --with-zlib \
        --enable-zip \
        --with-iconv=/usr/local \
        --enable-bcmath \
        --enable-calendar \
        --enable-exif \
        --enable-ftp \
        --enable-sockets \
        --enable-soap \
        --enable-mbstring \
        --with-icu-dir=/usr/local/icu \
        --enable-intl

Code:
/usr/local/php72/bin/php -m | grep -i "imap"
PHP Warning:  PHP Startup: Invalid library (maybe not a PHP library) 'imap.so' in Unknown on line 0
imap

Code:
/usr/local/php73/bin/php -m | grep -i "imap"
PHP Warning:  PHP Startup: Invalid library (maybe not a PHP library) 'imap.so' in Unknown on line 0
imap

Code:
/usr/local/directadmin/custombuild/build used_configs
Apache configuration file: /usr/local/directadmin/custombuild/configure/ap2/configure.apache
PHP (default) php.ini file: /usr/local/php72/lib/php.ini
PHP (additional) php.ini file: /usr/local/php73/lib/php.ini
PHP (default) configuration file: /usr/local/directadmin/custombuild/custom/php/configure.php72
PHP (additional) configuration file: /usr/local/directadmin/custombuild/custom/php/configure.php73
Exim Makefile: https://files-de.directadmin.com/services/custombuild/Makefile
Dovecot configuration file: /usr/local/directadmin/custombuild/configure/dovecot/configure.dovecot
phpMyAdmin configuration file: /usr/local/directadmin/custombuild/configure/phpmyadmin/config.inc.php

php extension in custom bild for imap is set to yes
before i post here i tried ./build php d and yum update

in /usr/local/php7*/lib/php.conf.d/10-directadmin.ini there is imap.so extension
 
Hello,
I had the same problem as well, no .ini files shown in here did have imap,
Code:
PHP (default) php.ini file: /usr/local/php72/lib/php.ini
PHP (additional) php.ini file: /usr/local/php74/lib/php.ini
PHP (default) configuration file: /usr/local/directadmin/custombuild/custom/fpm/configure.php72
PHP (additional) configuration file: /usr/local/directadmin/custombuild/configure/php/configure.php74

I installed IMAP from CustomBuild 2.0, I am using PHP7.2 and PHP7.4 with FPM. Finally I managed to fix the problem; the map extension was loaded on /usr/local/php72/lib/php.conf.d/10-directadmin.ini file. There was a
Code:
extension=imap.so
which I removed. The error seems gone. But will it break something on directadmin itself?
 
Back
Top