Edit report at https://bugs.php.net/bug.php?id=60504&edit=1

 ID:                 60504
 User updated by:    mike dot mackintosh at angrystatic dot com
 Reported by:        mike dot mackintosh at angrystatic dot com
 Summary:            PHP Warning:  Module 'ssh2' already loaded in
                     Unknown on line 0
-Status:             Open
+Status:             Closed
 Type:               Bug
 Package:            Dynamic loading
 Operating System:   Linux - Ubuntu 11.10
 PHP Version:        5.3SVN-2011-12-12 (SVN)
 Block user comment: N
 Private report:     N

 New Comment:

Personally, PHP should grab an MD5 of the ini's and if different, then load 
them, so it doesn't load the same config +1 time.

Closing bug.


Previous Comments:
------------------------------------------------------------------------
[2011-12-15 15:33:36] mike dot mackintosh at angrystatic dot com

Was able to resolve the issue by correcting the configuration:

Old configure:

'./configure'  '--prefix=/usr/local/php-5.3' '--enable-fastcgi' '--enable-cgi' 
'--enable-cli' '--disable-debug' '--disable-rpath' '--disable-static' 
'--with-pic' '--enable-bcmath' '--with-bz2' '--enable-calendar' 
'--enable-ctype' '--with-curl' '--with-zlib-dir=/usr' '--with-xsl' 
'--enable-exif' '--enable-ftp' '--enable-gd-native-ttf' '--with-ttf' 
'--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-freetype-dir=/usr' 
'--with-gettext' '--with-iconv' '--with-imap-ssl' '--with-kerberos=/usr' 
'--enable-mbstring' '--with-mcrypt' '--with-mhash' '--with-mime-magic' 
'--with-mysql=/usr/local/mysql-5.5' '--with-pcre-regex=/usr' 
'--with-pspell=/usr' '--enable-sockets' '--enable-wddx' '--with-xmlrpc' 
'--with-zlib=/usr' '--with-pear' '--with-layout=GNU' '--with-ldap' 
'--enable-pdo' '--enable-soap' '--with-apxs2=/usr/local/apache-2.2/bin/apxs' 
'--enable-pcntl' '--enable-mailparse' '--enable-zip' '--with-zip=/usr' 
'--with-bz2=/usr' '--with-config-file-path=/etc' 
'--with-config-file-scan-dir=/etc' '--with-pdo-mysql=/usr/local/mysql-5.5' 
'--enable-zip' '--with-snmp' 
'--with-mysqli=/usr/local/mysql-5.5/bin/mysql_config' '--with-phar' 
'--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--with-tidy' 
'--with-openssl=/usr/local/ssl' '--enable-phar'


New Configure:

'./configure'  '--prefix=/usr/local/php-5.3' '--enable-fastcgi' '--enable-cgi' 
'--enable-cli' '--disable-debug' '--disable-rpath' '--disable-static' 
'--with-pic' '--enable-bcmath' '--with-bz2' '--enable-calendar' 
'--enable-ctype' '--with-curl' '--with-zlib-dir=/usr' '--with-xsl' 
'--enable-exif' '--enable-ftp' '--enable-gd-native-ttf' '--with-ttf' 
'--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-freetype-dir=/usr' 
'--with-gettext' '--with-iconv' '--with-imap-ssl' '--with-kerberos=/usr' 
'--enable-mbstring' '--with-mcrypt' '--with-mhash' '--with-mime-magic' 
'--with-mysql=/usr/local/mysql-5.5' '--with-pcre-regex=/usr' 
'--with-pspell=/usr' '--enable-sockets' '--enable-wddx' '--with-xmlrpc' 
'--with-zlib=/usr' '--with-pear' '--with-layout=GNU' '--with-ldap' 
'--enable-pdo' '--enable-soap' '--with-apxs2=/usr/local/apache-2.2/bin/apxs' 
'--enable-pcntl' '--enable-mailparse' '--enable-zip' '--with-zip=/usr' 
'--with-bz2=/usr' '--with-config-file-path=/etc' 
'--with-config-file-scan-dir=/usr/local/php-5.3/etc' 
'--with-pdo-mysql=/usr/local/mysql-5.5' '--enable-zip' '--with-snmp' 
'--with-mysqli=/usr/local/mysql-5.5/bin/mysql_config' '--with-phar' 
'--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--with-tidy' 
'--with-openssl=/usr/local/ssl' '--enable-phar'

An emphisis should be placed on the differences in: 
'--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc' 
vs 
'--with-config-file-path=/etc' 
'--with-config-file-scan-dir=/usr/local/php-5.3/etc'

If the same path is used in both locations, it will load the php.ini twice, 
causing the error.

------------------------------------------------------------------------
[2011-12-12 21:06:51] mike dot mackintosh at angrystatic dot com

Description:
------------
Installed every version of PHP from SVN/Snapshots:

# php -m | grep ssh2
PHP Warning:  Module 'ssh2' already loaded in Unknown on line 0
ssh2

When you remove extension=ssh2.so from the php.ini file:

# php -m | grep ssh2


No modules are returned.


The module is loaded only once in the config when the already loaded error 
message is returned. A find / -name "*" -print | xargs grep "ssh2.so"

Returns the binary files in ~/ssh2-0.11.3 and 
/usr/local/php-5.3/lib/php/20090626/ as well as the /etc/php.ini file.

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

Only one file exists, and confirmed PHP is loading only one file.

Backtrace did not result in any useful information.




Test script:
---------------
Any code, simply, php -v

Expected result:
----------------
No message.

Actual result:
--------------
PHP Warning:  Module 'ssh2' already loaded in Unknown on line 0


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=60504&edit=1

Reply via email to