[php] PHP Warning: Module already loaded in Unknown on line 0

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

This question is related to php configuration centos7 ini intl

The answer is


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.


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');

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


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).


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.


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.


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.


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

In Windows 10, I fix this by comment like this

;extension=php_sockets.dll

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.....


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


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.


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


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

Comment out these two lines in php.ini

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

it should fix the issue.


Examples related to php

I am receiving warning in Facebook Application using PHP SDK Pass PDO prepared statement to variables Parse error: syntax error, unexpected [ Preg_match backtrack error Removing "http://" from a string How do I hide the PHP explode delimiter from submitted form results? Problems with installation of Google App Engine SDK for php in OS X Laravel 4 with Sentry 2 add user to a group on Registration php & mysql query not echoing in html with tags? How do I show a message in the foreach loop?

Examples related to configuration

My eclipse won't open, i download the bundle pack it keeps saying error log Getting value from appsettings.json in .net core pgadmin4 : postgresql application server could not be contacted. ASP.NET Core configuration for .NET Core console application Turning off eslint rule for a specific file PHP Warning: Module already loaded in Unknown on line 0 How to read AppSettings values from a .json file in ASP.NET Core How to store Configuration file and read it using React Hadoop cluster setup - java.net.ConnectException: Connection refused Maven Jacoco Configuration - Exclude classes/packages from report not working

Examples related to centos7

How to uninstall an older PHP version from centOS7 How to redirect output of systemd service to a file Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details How to Install gcc 5.3 with yum on CentOS 7.2? PHP Warning: Module already loaded in Unknown on line 0 How to install pip in CentOS 7? "psql: could not connect to server: Connection refused" Error when connecting to remote database CentOS 7 and Puppet unable to install nc How to get ip address of a server on Centos 7 in bash resize2fs: Bad magic number in super-block while trying to open

Examples related to ini

PHP Warning: Module already loaded in Unknown on line 0 Python: How would you save a simple settings/config file? How to increase maximum execution time in php How to read and write INI file with Python3? How do I grab an INI value within a shell script? How to locate the php.ini file (xampp) PHP ini file_get_contents external url Do standard windows .ini files allow comments? Reading/writing an INI file What is the easiest way to parse an INI file in Java?

Examples related to intl

PHP Warning: Module already loaded in Unknown on line 0 intl extension: installing php_intl.dll