Unable to use the MySQLi database because the MySQLi extension for PHP is not installed.

I get this error when I switched my Drupal from IIS7 to Apache 2.2.15.
With IIS-7 - it runs fine,
When I switch to Apache I get the above error.

I didn't change the code in my php.ini - currently:

;extension=php_mssql.dll
extension=php_mysql.dll
extension=php_mysqli.dll
;extension=php_oci8.dll

The file mysqli.dll does exists on the server.

And I've googled for a solution but get all the same responses, to check the php.ini or httpd.conf file - but it runs fine under IIS-7

Please advise a solution?

PhotoMan2000Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

junipllcCommented:
The first thing I would do is to run a phpinfo -- create an HTML file and put the code below into it. Then load the page in your Web browser, using the Apache server. (forgive me if this is elementary for you, I don't know what your level of experience with PHP and/or Apache is)

If you look through the output from phpinfo you might be able to find out where it is failing, or if, indeed, the MySQL libraries are being loaded into the PHP/Apache stack. If they aren't, then this is usually  caused by some sort of library or extension missing in your installation, or possibly that Apache isn't loading the proper module -- which is why everybody is telling you to check httpd.conf and php.ini.

Keep in mind that on my systems (Linux, but similar since you're using an xAMP stack) the php.ini file for Apache and the php.ini file for command-line or other Web servers is actually a completely different, separate file, so be sure you're checking the proper php.ini for loaded extensions (the line that loads mysqli looks something like this on my system: extension=mysqli.so)

If you can't figure it out you can always post the phpinfo output here....but beware that it is a security risk to do so, as there is a lot of information in that output that can be used maliciously.

I hope this makes sense...I'd be happy to help further if you can't solve the problem.

<?php phpinfo(); ?>

Open in new window

0
junipllcCommented:
One more thing -- I'm not super-familiar with the Windows implementation of Apache modules, but I believe the module will have the (above) .so extension, not .dll. I could be way off base though.

Did you start with the WAMP server? If not, try using this to set up an environment with MySQL, Apache and PHP all pre-configured:

http://www.wampserver.com/en/

It will most likely prevent migraines, injuries due to frustration, and other unpleasantness that you will find trying to manually configure a stack yourself.

Mike
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
PhotoMan2000Author Commented:
Hi,
I've looked at both the PHP.ini and HTTP.CONF and all seems fine.
I posted the php.ini, before, here is the php section for the httpd.conf which appears at the very bottom of the file:

LoadModule php5_module "c:/php/php5apache2_2.dll"
AddType application/x-httpd-php .php
PHPIniDir "C:/php"

The paths are accurate and the file is in it's proper place.

Here is the mysqli from the php info - it only runs on my local drive so I'm not worried about any external  security.

mysqli
MysqlI Support      enabled
Client API library version       5.0.51a
Client API header version       5.0.51a
MYSQLI_SOCKET       /tmp/mysql.sock

Directive      Local Value      Master Value
mysqli.default_host      no value      no value
mysqli.default_port      3306      3306
mysqli.default_pw      no value      no value
mysqli.default_socket      no value      no value
mysqli.default_user      no value      no value
mysqli.max_links      Unlimited      Unlimited
mysqli.reconnect      Off      Off


One thought.. does the sequence of installing PHP and Apache matter? I installed PHP first then Apache.

If I switch to the WAMP -- should I remove my previous Apachee and PHP installed before installing WAMP?

Thanks!
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

junipllcCommented:
That certainly looks pretty good to me...especially since it's showing enabled. That makes me think there is a problem with Apache's config...but I can't be sure.

Usually when I install a stack I use a preconfigured one...but if not I install in this order: Apache, PHP, MySQL. If I need any extra libraries, I install them after that.

I think you will be better off with WAMP...it's all configured out-of-the-box for exactly what you're trying to do. It's less of a challenge ;) but it's also a heck of a lot easier. Most Drupalers (is that a correct term?) use a stack like LAMP on Linux, MAMP on the Mac or WAMP on Windows because it's tried and tested...and because it simply works. :) I think they even have T-shirts dedicated to the LAMP (WAMP/MAMP) stack:

http://www.tshirtbordello.com/Shirts/c1/p405/I-love-(heart)-LAMP-T-Shirt/product_info.html

If you do switch to WAMP I would probably remove Apache and PHP...but only if you don't have any crazy customization going on...or at the very least I'd back everything up if you have anything to lose in your configuration before you install WAMP.

Let me know how it works out (or doesn't) -- but I'm 95% certain this will solve your problem, and then some.

Mike
0
PhotoMan2000Author Commented:
Thanks I'll give WAMP a try and uninstall the others.
I'll get back to you on this shortly..

0
conticreativeCommented:
Actually, WAMP is not the best choice at the moment. Try XAMP. It's much better than WAMP (for macs try MAMP).

XAMP is what I use but I used WAMP for years. I find XAMP a lot more stable and easier to use. I eventually switched from WAMP to XAMP because WAMPat the time refused to work on VISTA.

Things may have changed lately but XAMP remains a solid solution.
0
PhotoMan2000Author Commented:
This is what eventually worked - but I had to uninstall both PHP and Apache - then WAMP.  I was never able to figure out why the other wasn't working.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.