PHP Warning: Module already loaded in Unknown on line 0
Asked Answered
C

21

114

On Mac OSX Mavericks using homebrew php55 whenever I run a a php command I get the following error message (everything runs fine it's just annoying)

PHP Warning:  Module 'intl' already loaded in Unknown on line 0

I ran

php --ini

and the output was

php --ini
PHP Warning:  Module 'intl' already loaded in Unknown on line 0

Warning: Module 'intl' already loaded in Unknown on line 0
Configuration File (php.ini) Path: /usr/local/etc/php/5.5
Loaded Configuration File:         /usr/local/etc/php/5.5/php.ini
Scan for additional .ini files in: /usr/local/etc/php/5.5/conf.d
Additional .ini files parsed:      /usr/local/etc/php/5.5/conf.d/ext-apcu.ini,
/usr/local/etc/php/5.5/conf.d/ext-igbinary.ini,
/usr/local/etc/php/5.5/conf.d/ext-intl.ini,
/usr/local/etc/php/5.5/conf.d/ext-memcached.ini,
/usr/local/etc/php/5.5/conf.d/ext-mongo.ini,
/usr/local/etc/php/5.5/conf.d/ext-uuid.ini,
/usr/local/etc/php/5.5/conf.d/ext-xdebug.ini

Checked in the php.ini file and the only place intl is loaded is at the top and it's commented out. The other files contents look something like:

extension="/usr/local/Cellar/php55/5.5.23/lib/php/extensions/no-debug-non-zts-20121212/intl.so"

where the contents after the last slash is the extension.

I'm not sure where else to look.

Any help is appreciated

Consecrate answered 24/9, 2015 at 15:13 Comment(3)
Check /usr/local/etc/php/5.5/conf.d/ext-intl.ini and /usr/local/etc/php/5.5/php.ini Most likely it's there more than once.Coquille
Try to enable the intl extension at the php.ini file and remove (with back up) the file ext-intl.iniAenneea
I solved this problem by checking each of the .ini file under the conf.d directory, and found there's two same line extension=imagick.so in the imagick.ini, and I removed one of them it works fineLabourite
S
93

I think you have loaded Xdebug probably twice in php.ini.

  1. check the php.ini, that not have set xdebug.so for the values extension= and zend_extension=.

  2. Check also /etc/php5/apache2 and /etc/php5/cli/. You should not load in each php.ini in these directories the extension xdebug.so. Only one file, php.ini should load it.

    Note: Inside the path is the string /etc/php5. The 5 is the version of PHP. So if you use another version, you always get a different path, like php7.

Selfdenial answered 6/4, 2016 at 15:3 Comment(2)
Hey , I can't find xdebug in my cli/php.ini and still its showing me these errors. PHP Warning: PHP Startup: Unable to load dynamic library 'gd2' (tried: /usr/lib/php/20170718/gd2 (/usr/lib/php/20170718/gd2: cannot open shared object file: No such file or directory), /usr/lib/php/20170718/gd2.so (/usr/lib/php/20170718/gd2.so: cannot open shared object file: No such file or directory)) in Unknown on line 0Roundtree
on my one (mac, php installed using brew), when I install xhprof using pecl, it automatically added extension='xhprof.so' at the top of php.ini file. and then there was another file at /usr/local/etc/php/7.2/conf.d/ext-xhprof.ini. commenting out the line on php.ini removed the warning.Carruthers
D
27

I had the same issue on mac i.e. Warning: Module 'pdo_pgsql' already loaded in Unknown on line 0. Here's how I solved it.

  • Locate the folder conf.d, mine was in the directory /usr/local/etc/php/7.0/conf.d.
  • In this folder, there's a file called ext-pdo_pgsql.ini.
  • Type sudo nano ext-pdo_pgsql.ini to edit it.
  • There should be a line extension="/usr/local/opt/php70-pdo-pgsql/pdo_pgsql.so". Comment it out by adding semi-colon to the beginning of the line i.e. ;extension="/usr/local/opt/php70-pdo-pgsql/pdo_pgsql.so".
  • Save the file. (I usually run control + O, control + M).
  • Exit the file (control + X).

Hope this helps someone.

Disconformity answered 15/5, 2017 at 8:36 Comment(2)
This worked for me for 'mongodb' issue in ubuntu 18.04. I found similar file for mongodb in etc/php/7.2/apache2/conf.dGarlandgarlanda
worked as well for me with pgsql.iniKabul
R
19

To fix this problem, you must edit your php.ini (or extensions.ini) file and comment-out the extensions that are already compiled-in. For example, after editing, your ini file may look like the lines below:

;extension=pcre.so
;extension=spl.so

Source: http://www.somacon.com/p520.php

Rustin answered 18/12, 2016 at 22:11 Comment(1)
This is correct. in my case, i had mysqli extension called twice so i commented out one of them and everything went back to normal.Tomb
A
12

You should have a /etc/php2/conf.d directory (At least on Ubuntu I do) containing a bunch of .ini files which all get loaded when php runs. These files can contain duplicate settings that conflict with settings in php.ini. In my PHP installation I notice a file conf.d/20-intl.ini with an extension=intl.so setting. I bet that's your conflict.

Agnosticism answered 15/6, 2016 at 18:9 Comment(1)
You can use php --ini | grep intl to find extra ini files for the module and check the php.ini file if it has extension=intl.so. As a solution, you can comment the later in the php.ini or delete the file(s) show in the first command.Merv
N
9

solved by commenting extension=curl

Ninanincompoop answered 24/4, 2022 at 11:0 Comment(0)
M
6

In my case I had uncoment the ;extension=php_curl.so in php.ini, but Ubuntu was already calling this extension somewhere else.

To find this "somewhere else", on php.ini will informe. On my case: /etc/php/7.1/apache2/conf.d/20-curl.ini was the path.

So now we edit this file (terminal):

sudo nano /etc/php/7.1/apache2/conf.d/20-curl.ini

Comment the ;extension=php_curl.so

Save file and restart apache:

sudo systemctl restart apache2
Massa answered 30/3, 2018 at 7:13 Comment(0)
J
3
For issue related to code igniter project upload,
go to the base directory index.php and add this code:

if ($_SERVER['SERVER_NAME'] == 'local_server_name') {
    define('ENVIRONMENT', 'development');
} else {
    define('ENVIRONMENT', 'production');
}

if (defined('ENVIRONMENT')){
    switch (ENVIRONMENT){
        case 'development':
            error_reporting(E_ALL);
        break;

        case 'testing':
        case 'production':
            error_reporting(0);
        break;

        default:
            exit('The application environment is not set correctly.');
    }
}


    define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'development');
Julijulia answered 13/4, 2020 at 20:38 Comment(1)
While this code may solve the question, including an explanation of how and why this solves the problem would really help to improve the quality of your post, and probably result in more up-votes. Remember that you are answering the question for readers in the future, not just the person asking now. Please edit your answer to add explanations and give an indication of what limitations and assumptions apply.Tajuanatak
R
3

For shared hosting, in cPanel I unchecked the Module in question under "Select PHP Version" > "Extensions" and the error disappeared for PHP 7.4.

Rask answered 14/6, 2020 at 1:30 Comment(0)
N
2

I had the same issue after upgrading from Fedora Server 24 (PHP 5) to 25 (PHP 7). After investigation, I found that /etc/php.d/ had two different .ini files loading extension=geoip.so.

Previous version of distros had this file named 50-geoip.ini but the recent was changed to 40-geoip.ini, and I suspect that in the version-upgrade process the old hasn't been removed, while the new one has been created.

That was the actual case of the issue. After removing stray 50-geoip.ini from /etc/php.d/ and restarting httpd it just worked flawlessly.

Nodical answered 12/12, 2016 at 19:52 Comment(0)
C
1

I deleted the 20-mongo.ini file in /etc/php5/cli/conf.d and this solved the problem.

Counterfoil answered 8/7, 2017 at 12:33 Comment(0)
G
1

I figured this out by printing the PHP configuration and searching by xml.ini. Notice in the following output how xml is loaded twice (first as 20-xml.ini and then as xml.ini):

$ php -i | grep xml
/etc/php.d/20-simplexml.ini,
/etc/php.d/20-xml.ini,
/etc/php.d/20-xmlwriter.ini,
/etc/php.d/30-xmlreader.ini,
/etc/php.d/xml.ini
xmlrpc_error_number => 0 => 0
xmlrpc_errors => Off => Off
libxml Version => 2.9.1
libxml
mbstring.http_output_conv_mimetypes => ^(text/|application/xhtml\+xml) => ^(text /|application/xhtml\+xml)
xml
libxml2 Version => 2.9.1
xmlreader
xmlwriter
libxslt compiled against libxml Version => 2.9.1
Guib answered 30/4, 2020 at 10:49 Comment(0)
E
0

There are two "php_intl.dll" files inside php.ini file on 872 and 968 number lines. if php warning module 'intl' already loaded in unknown on line 0 this message is focused on your CLI. Then you should have to remove the semiclone prefixes on line 872. I expect this will done.....

Elgin answered 24/9, 2015 at 15:13 Comment(0)
H
0

Just for the record as it might help others who are on shared hosting (cPanel).

I had error on shared hosting php7.2: Module 'imagick' already loaded in Unknown on line 0

In the beginning hosting provider said it was my bad configuration (running Yii2.16). But after I showed them, that all Internet related this issue to server configuration -they started to listen to me. After I proved, that there was no error on php7.1 they started to search for the error.

As they told to me - the error was due to configuration in PERL modules or PEAR package, but they did not told me the real issue.

So, if you are on shared hosting - talk to you provider and experiment with PHP versions (if you can change them).

Heyday answered 11/3, 2019 at 13:33 Comment(0)
C
0

Comment out these two lines in php.ini

;extension=imagick.so
;extension="ixed.5.6.lin"

it should fix the issue.

Commitment answered 16/8, 2019 at 16:34 Comment(0)
P
0

In Windows 10, I fix this by comment like this

;extension=php_sockets.dll
Phrasing answered 18/11, 2020 at 0:0 Comment(0)
C
0

Run php --ini and notice file path on Loaded Configuration File.
Then run command like cat -n /etc/php/7.2/cli/php.ini | grep intl to find if the extension is commented or not.
Then update loaded configuration file by commenting line by adding ; such as ;extension=intl

This can happen when you install php-intl package and also enable the same extension on php.ini file.

Commitment answered 13/1, 2021 at 9:47 Comment(0)
C
0

If you are on shared hosting, just apply the default php settings. Cpanel overrides php settings to default.

Convincing answered 5/3, 2021 at 23:39 Comment(1)
This is likely to be a commentHekate
F
0

I am using WAMP in Windows 10 with PHP 7.2.10. I was able to solve it through commenting the line extension=ftp in php.ini inside wamp64\bin\php\php7.2.10 .

I am unsure but my guess why this happens is that my php.ini inside wamp64\bin\apache\apache2.4.35\bin already loads this module.

Be sure to restart all services of WAMP after doing so.

Foxtail answered 23/3, 2021 at 5:40 Comment(0)
S
0

I resolved this issue by removing php.ini file from extension=grpc commenting like this ;extension=grpc

Simmie answered 2/12, 2021 at 5:44 Comment(0)
C
0

If you install PHP using MacPorts (I know, call me a dinosaur), it doesn't create a php.ini file. Instead it creates a bunch of ini files in /opt/local/var/db/php82 (or whatever version you installed) which are also read. If you create a php.ini yourself, and assume you have to add the extensions, as any sane person would, you will see this error.

This is what my installation looks like.

% ll /opt/local/var/db/php82 
total 144
drwxr-xr-x  21 root  admin  672 Nov 17 07:22 .
drwxr-xr-x   5 root  wheel  160 Nov 16 19:23 ..
-rw-r--r--   1 root  admin  231 Nov 17 06:52 curl.ini
-rw-r--r--   1 root  admin  227 Nov 17 06:51 gd.ini
-rw-r--r--   1 root  admin  237 Nov 17 06:53 gettext.ini
-rw-r--r--   1 root  admin  233 Nov 17 06:53 iconv.ini
-rw-r--r--   1 root  admin  231 Nov 17 06:56 imap.ini
-rw-r--r--   1 root  admin  231 Nov 17 06:52 intl.ini
-rw-r--r--   1 root  admin  239 Nov 17 06:55 mbstring.ini
-rw-r--r--   1 root  admin  235 Nov 17 06:57 mcrypt.ini
-rw-r--r--   1 root  admin  257 Nov 17 06:58 mysql.ini
-rw-r--r--   1 root  admin  300 Nov 17 07:02 opcache.ini
-rw-r--r--   1 root  admin  237 Nov 17 06:58 openssl.ini
-rw-r--r--   1 root  admin  237 Nov 17 06:58 sockets.ini
-rw-r--r--   1 root  admin  260 Nov 17 07:03 sqlite.ini
-rw-r--r--   1 root  admin  231 Nov 17 07:02 tidy.ini
-rw-r--r--   1 root  admin  298 Nov 17 07:22 xdebug.ini
-rw-r--r--   1 root  admin  235 Nov 17 06:57 xmlrpc.ini
-rw-r--r--   1 root  admin  229 Nov 17 07:02 xsl.ini
-rw-r--r--   1 root  admin  229 Nov 17 07:00 zip.ini

cat /opt/local/var/db/php82/mysql.ini
; Do not edit this file; it is automatically generated by MacPorts. Any changes
; you make will be lost if you upgrade, uninstall or deactivate php82-mysql.
; To configure php82, edit /opt/local/etc/php82/php.ini.
extension=mysqli.so
extension=pdo_mysql.so

There is no /opt/local/etc/php82/php.ini. Instead there are two files: php.ini-development and php.ini-production, which you can use as templates for your php.ini.

Canvasback answered 2/12, 2023 at 16:58 Comment(0)
J
-1

I had a similar problem, the problem was that the extension intl was duplicated.

You can check in file C:/xampp/php/php.ini and find "intl". In my case extension=intl is already present and I scrolled again and found a second intl "extension=php_intl.dll".

The extension must one to execution can't execution extension intl again. This will show error like this "Module 'intl' already loaded".

I fixed it by commenting out extension=php_intl.dll using ";" like this ;extension=php_intl.dll. and restarted the apache service.

Janina answered 6/1, 2019 at 2:20 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.