php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60504 PHP Warning: Module 'ssh2' already loaded in Unknown on line 0
Submitted: 2011-12-12 21:06 UTC Modified: 2011-12-15 15:34 UTC
From: mike dot mackintosh at angrystatic dot com Assigned:
Status: Closed Package: Dynamic loading
PHP Version: 5.3SVN-2011-12-12 (SVN) OS: Linux - Ubuntu 11.10
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mike dot mackintosh at angrystatic dot com
New email:
PHP Version: OS:

 

 [2011-12-12 21:06 UTC] 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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-12-15 15:33 UTC] 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-15 15:34 UTC] mike dot mackintosh at angrystatic dot com
-Status: Open +Status: Closed
 [2011-12-15 15:34 UTC] mike dot mackintosh at angrystatic dot com
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.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Feb 05 04:01:31 2025 UTC