PHP Warning: Module already loaded in Unknown on line 0

前端 未结 15 1157
抹茶落季
抹茶落季 2020-11-27 16:38

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 War         


        
相关标签:
15条回答
  • 2020-11-27 17:28

    In Windows 10, I fix this by comment like this

    ;extension=php_sockets.dll
    
    0 讨论(0)
  • 2020-11-27 17:30

    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.

    0 讨论(0)
  • 2020-11-27 17:30

    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

    0 讨论(0)
  • 2020-11-27 17:30
    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');
    
    0 讨论(0)
  • 2020-11-27 17:30

    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.

    0 讨论(0)
  • 2020-11-27 17:34

    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.

    0 讨论(0)
提交回复
热议问题