Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 306
Drew Landgrave Avatar asked Sep 24 '15 15:09

Drew Landgrave


3 Answers

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.

like image 135
bueltge Avatar answered Oct 18 '22 20:10

bueltge


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.

like image 27
Allan Mwesigwa Avatar answered Oct 18 '22 19:10

Allan Mwesigwa


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

like image 13
J.C. Gras Avatar answered Oct 18 '22 18:10

J.C. Gras