PHP warning after 5.3.3 -> 5.3.3_1 bump

Morgan Wesström freebsd-ports at
Thu Aug 26 14:37:21 UTC 2010

>>> Upgraded lang/php from port revision 5.3.3 to 5.3.3_1 yesterday to
>>> include the new native MySQL drivers. Now I get the following warning
>>> every time a php script is executed:
>>> PHP Warning:  Module 'zlib' already loaded in Unknown on line 0
>>> Even a simple "php -v" displays this warning.
>>> - I have rebuilt php and all ports depending on it.
>>> - I have verified that extensions.ini doesn't contain duplicates.
>>> - I have searched for any other references to zlib.
>>> This isn't critical I guess, but annoying. Any suggestions on how to
>>> solve this would be appreciated.
>>> Regards
>>> Morgan
>> Hi Morgan,
>> The only time that I've seen that error, it has been caused by duplicate
>> extension loading.  If you've already removed duplicates from your
>> extensions.ini file, set up a page with the phpinfo() function so you
>> can see what other .ini file directories might be in the search path.

The output from phpinfo is listed below and shows no traces of other
ini-files than the default.

Configuration File (php.ini) Path
Loaded Configuration File
Scan this dir for additional .ini files
Additional .ini files parsed

>> You might even get some good information from this command:
>> truss -f -a -s 256 -o /tmp/php-cli.log php -v
>> Once the process exits, check the /tmp/php-cli.log file and search for
>> "zlib" in it.  You might see the zlib extension loaded more than once
>> and be able to determine what .ini file is causing the duplication.

It only seems to be loaded once.

# grep -E 'ini|zlib' /tmp/php-cli.log
11897: open("/usr/local/bin/php-cli.ini",O_RDONLY,0666) ERR#2 'No such
file or directory'
11897: open("/usr/local/etc/php-cli.ini",O_RDONLY,0666) ERR#2 'No such
file or directory'
11897: open("/usr/local/bin/php.ini",O_RDONLY,0666) ERR#2 'No such file
or directory'
11897: open("/usr/local/etc/php.ini",O_RDONLY,0666) = 3 (0x3)
11897: lstat("/usr/local/etc/php.ini",{ mode=-r--r--r--
,inode=14156568,size=46214,blksize=16384 }) = 0 (0x0)
11897: stat("/usr/local/etc/php/extensions.ini",{ mode=-rw-r--r--
,inode=19524774,size=922,blksize=16384 }) = 0 (0x0)
11897: open("/usr/local/etc/php/extensions.ini",O_RDONLY,0666) = 3 (0x3)
11897: open("/usr/local/lib/php/20090626/",O_RDONLY,044) = 3 (0x3)
11897: write(3,"[26-Aug-2010 16:28:27] PHP Warning:  Module 'zlib'
already loaded in Unknown on line 0\n",87) = 87 (0x57)

> If this is true, then would be considered "redundant"
> and cause the warning seen.  You could test the validity of my claim by
> commenting out (using semi-colon) in extensions.ini
> and then use php -i and see if zlib is listed as a loaded extension.

You are correct Jeremy. Commenting out removes the warning and
zlib still shows up as a loaded module when I do php -i.

Can I provide any further tests or information for you?


More information about the freebsd-ports mailing list