Joseph Astrahan
Joseph Astrahan

Reputation: 9072

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

I've recently installed symfony 3, and while it seems to be working okay, I noticed that my error logs keep filling up with the following message.

[10-Jan-2016 01:03:11 America/Chicago] PHP Warning:  Module 'intl' already loaded in Unknown on line 0

After looking into it, I set these in my composer.json file to see if it would help.

"symfony/intl": "^3.0.1",
"symfony/polyfill-intl-icu": "^1.0"

but I still see the errors after I do anything with the page, like refresh it, or try to enter in my login etc...

The full composer.json is below with my domain name replaced with example.com for security reasons.

{
    "name": "root/example.com",
    "license": "proprietary",
    "type": "project",
    "autoload": {
        "psr-4": {
            "": "src/"
        },
        "classmap": [
            "app/AppKernel.php",
            "app/AppCache.php"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "require": {
        "php": ">=5.5.9",
        "symfony/symfony": "3.0.*",
        "doctrine/orm": "^2.5",
        "doctrine/doctrine-bundle": "^1.6",
        "doctrine/doctrine-cache-bundle": "^1.2",
        "symfony/swiftmailer-bundle": "^2.3",
        "symfony/monolog-bundle": "^2.8",
        "sensio/distribution-bundle": "^5.0",
        "sensio/framework-extra-bundle": "^3.0.2",
        "incenteev/composer-parameter-handler": "^2.0",
        "symfony/intl": "^3.0.1",
        "symfony/polyfill-intl-icu": "^1.0"
    },
    "require-dev": {
        "sensio/generator-bundle": "^3.0",
        "symfony/phpunit-bridge": "^2.7"
    },
    "scripts": {
        "post-install-cmd": [
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
        ],
        "post-update-cmd": [
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
        ]
    },
    "extra": {
        "symfony-app-dir": "app",
        "symfony-bin-dir": "bin",
        "symfony-var-dir": "var",
        "symfony-web-dir": "web",
        "symfony-tests-dir": "tests",
        "symfony-assets-install": "relative",
        "incenteev-parameters": {
            "file": "app/config/parameters.yml"
        }
    }
}

Also I tried following the advice on a question similar to mine here (Problems installing Symfony 2.4.1 lib-icu 4.4 dependency), but when I tried to set "symfony/icu": "1.1.*", composer refused to do it because I'm using symfony 3...

I'm not even sure if my issues are same as his.

I'm using WHM/Cpanel on Centos Linux Server in case there is any UNIX commands I need to run to solve this.

I believe I have installed the intl extension already via the WHM control panel as well, but I'm not 100% sure I did this correctly either. I've attached an image of how it looks in my control panel.

enter image description here

I've also tried following instructions here (http://symfony.com/doc/current/components/intl.html)

How do I get rid of the error message?

Upvotes: 1

Views: 1306

Answers (2)

marcv
marcv

Reputation: 1976

SensioDistributionBundle before v5.0.17 creates this kind of errors when used with Composer v1.3 (more details).

Check if you could be affected:

composer --version && composer show | grep distribution-bundle

If so, get rid of the problem by updating SensioDistributionBundle to the latest version:

composer update sensio/distribution-bundle

Upvotes: 0

Sasindu Mendis
Sasindu Mendis

Reputation: 356

I believe this is not Symfony related.

Usually the case is your installed PHP version compiled with --with-intl option (intl built-in) and you have also installed intl extension.

Try to disable/ uninstall the intl extension and test if you can still use symfony/intl features without issues.

Upvotes: 2

Related Questions