PHP Warning: Module already loaded in Unknown on line 0

PHP Warning: Module already loaded in Unknown on line 0

  1. Blog
  2. 15 November 2026
  3. 3 min read

Stefan Bogdanescu

Founder & Senior Architect

PHP Warning: Module already loaded in Unknown on line 0

When you see PHP Warning: Module 'intl' already loaded in Unknown on line 0, your instinct might be to think a configuration file is broken. However, this specific warning often indicates that the extension has already been successfully initialized by PHP before it tried to load it again from a separate .ini file.

This behavior was notably common on macOS systems running Homebrew installations of older PHP versions, such as PHP 5.5 under OS X Mavericks. The core issue usually stems from how the php.ini loader processes directives versus how shared extensions are actually loaded by the engine.

To understand why this happens, you have to look at the initialization order. When PHP starts, it scans the main configuration file and any files in the conf.d/ directory. If a line like extension=intl appears explicitly in your main php.ini, PHP loads the C extension for that module immediately. Later, if another configuration file—perhaps one included via an external loader or a conflicting directive in a different path—attempts to load the same extension again using extension=/path/to/intl.so, the engine detects the duplicate. Since the module is already active, it cannot be loaded twice, resulting in the warning you are seeing.

In the scenario described with Homebrew PHP 5.5, the php --ini output reveals a specific list of additional .ini files being parsed from /usr/local/etc/php/5.5/conf.d/. You can see entries like ext-intl.ini in that list. The user noted that the main configuration file had intl commented out at the top, yet the warning persisted. This discrepancy suggests that the extension was likely loaded via a different mechanism before the explicit .ini file was processed, or the loader is picking up a global system library alongside the Homebrew one.

The standard resolution involves auditing your php.ini and all files in the conf.d/ directory. You need to ensure that you do not have duplicate entries for the same extension across different files. For example, if ext-apcu.ini is included from a global location but you also manually include it in your local config, you will get similar warnings for APCu or other modules.

A critical decision point here is understanding whether you need to load the extension multiple times for different SAPIs (Server Application Interfaces). In some complex setups, php.ini handles CLI while a separate file handles FPM or Apache. However, if both environments are pointing to the same binary and loading the same shared object, you must ensure the directive is only defined once in the effective configuration hierarchy.

If you are using Homebrew, it is often cleaner to let the package manager manage these extensions rather than manually editing system paths. You can verify which PHP binary is actually running by checking which php or inspecting the binary's linked libraries using otool -L $(which php). If the warning persists and you confirm no duplicate lines exist in your active config files, the issue might be a stale cache or a bug specific to that version of PHP on Mavericks.

In modern Laravel projects, which often run on newer PHP versions, this specific warning is rare because the ecosystem has evolved to handle extension loading more robustly. If you are maintaining legacy code or migrating from an older stack, encountering this warning can be annoying but usually harmless regarding functionality. The application will continue to run; it is purely a noise issue indicating redundant configuration attempts.

To silence the warning effectively without breaking logic, locate every instance of extension=intl or extension=/path/to/intl.so across your entire configuration tree. Ensure that only one active directive remains for each extension per binary. If you are unsure about a file in conf.d/, check its source to see if it is being pulled from a global environment variable like php_apc.ini which might conflict with Homebrew defaults.

If the warning appears during CLI execution but not in web contexts, or vice versa, investigate whether your environment variables (like PHPRC) are pointing to conflicting configuration directories that load the same extensions twice. Cleaning up these paths and ensuring a single source of truth for your PHP configuration usually resolves the "Unknown on line 0" confusion.

Our network