how to stop this PHP warning message?

areyouready344
areyouready344 used Ask the Experts™
on
I get the following PHP warning message when executing the PHP command below. How can I overcome this warning message?

# php test2.php
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/msqli.so' - /usr/lib/php/modules/msqli.so: cannot open shared object file: No such file or direc0
PHP Warning:  Module 'mysqli' already loaded in Unknown on line 0
object(MyClass)#1 (0) {
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
This is just a shot in the dark, because I've never heard of msqli (as opposed to mysqli), but it may be an error in your php.ini file. Do you happen to have a line like 'extension=msql.so' in there? If so either change it into 'extension=mysqli.so' if you're using mysqli or just remove it.

Ruben.

Author

Commented:
After commenting out  -->> ;extension=mysql.so

 I no longer get the following warning message

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/msqli.so' - /usr/lib/php/modules/msqli.so: cannot open shared object file: No such file or direc0


However, I still get the following message:

PHP Warning:  Module 'mysqli' already loaded in Unknown on line 0

Commented:
Does the php.ini also contains the line 'extension=mysqli.so' twice?
Or otherwise does it get loaded for the second time at runtime using the dl function somewhere?
OWASP: Avoiding Hacker Tricks

Learn to build secure applications from the mindset of the hacker and avoid being exploited.

Author

Commented:
# find / -name mysqli.so
/usr/lib/php/modules/mysqli.so


Also, the php.ini only show one location of this value


extension=/usr/lib/php/modules/mysqli.so


This one is commented out

;extension=msqli.so

Author

Commented:
okay I commented out

;extension=/usr/lib/php/modules/mysqli.so


and the message no longer show up...

thanks for leading me in the right direction but I thought I need this value mysqli.so?
Dave BaldwinFixer of Problems
Most Valuable Expert 2014

Commented:
What version of Linux are you using?  Some of them do things differently.

Author

Commented:
I'm using centOS 6
Commented:
It must mean that the mysqli module is being loaded somewhere else besides php.ini. Is your testscript just a small script containing a few lines of code or does it include other php files? Can you post the code?
Also can you post the output of php -i
It's long but it might contain some pointers in the right direction (maybe a custom php.ini file?).

Ruben.
Most Valuable Expert 2011
Top Expert 2016

Commented:
Hmm... I did not see any "magic bullets" but maybe something in the man pages will turn up.
http://www.php.net/manual/en/mysqli.setup.php

Sometimes this little script is useful:
<?php phpinfo();

Open in new window

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial