20111213

PHP Startup: Unable to load dynamic library



I check my apache error log,

less /usr/local/apache/logs/error_log

PHP Warning:  PHP Startup: Unable to load dynamic library './mssql.so' - ./mssql.so: cannot open shared object file: No such file or directory in Unknown on line 0
[Mon Dec 12 21:53:25 2011] [notice] Apache/2.2.3 (Unix) PHP/5.2.5 configured -- resuming normal operations

so I do below,

find / -name mssql.so

/usr/local/src/php-5.2.5/ext/mssql/modules/mssql.so
/usr/local/src/php-5.2.5/ext/mssql/.libs/mssql.so
/usr/local/php/lib/php/extensions/no-debug-zts-20060613/mssql.so
/usr/local/php/lib/php/extensions/mssql.so

and I copy the file 'mssql.so',

cp /usr/local/php/lib/php/extensions/no-debug-zts-20060613/mssql.so /usr/local/php/lib/php/extensions/

and restart the httpd,

/usr/local/apache/bin/httpd -k restart

check my apache error log again,

less /usr/local/apache/logs/error_log

[Tue Dec 13 22:06:49 2011] [notice] SIGHUP received.  Attempting to restart
PHP Warning:  PHP Startup: Unable to load dynamic library './mssql.so' - ./mssql.so: cannot open shared object file: No such file or directory in Unknown on line 0
[Tue Dec 13 22:06:49 2011] [notice] Apache/2.2.3 (Unix) PHP/5.2.5 configured -- resuming normal operations

find other server that works normal with 'mssql.so', the php.ini is something different !!

vim /etc/php.ini

; Directory in which the loadable extensions (modules) reside.
; extension_dir = "./"

so i comment the extension_dir = "./" with ' ; ', save the php.ini and restart the httpd,

/usr/local/apache/bin/httpd -k restart

check my apache error log again,

less /usr/local/apache/logs/error_log

[Tue Dec 13 22:10:15 2011] [notice] SIGHUP received.  Attempting to restart
PHP Warning:  Module 'mssql' already loaded in Unknown on line 0
[Tue Dec 13 22:10:15 2011] [notice] Apache/2.2.3 (Unix) PHP/5.2.5 configured -- resuming normal operations

vim /etc/php.ini

find 'mssql.so' and comment the line with ' ; ', save the php.ini and restart the httpd,

;extension=mssql.so

/usr/local/apache/bin/httpd -k restart

check my apache error log again,

less /usr/local/apache/logs/error_log

[Tue Dec 13 22:13:13 2011] [notice] SIGHUP received.  Attempting to restart
[Tue Dec 13 22:13:13 2011] [notice] Apache/2.2.3 (Unix) PHP/5.2.5 configured -- resuming normal operations

done.