[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

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

Posted on 2010-04-06
7
Medium Priority
?
1,631 Views
Last Modified: 2013-12-13
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?

0
Comment
Question by:PhotoMan2000
  • 3
  • 3
7 Comments
 
LVL 12

Expert Comment

by:junipllc
ID: 29967744
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
 
LVL 12

Accepted Solution

by:
junipllc earned 2000 total points
ID: 29968352
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
 

Author Comment

by:PhotoMan2000
ID: 30027539
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
Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

 
LVL 12

Expert Comment

by:junipllc
ID: 30029523
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
 

Author Comment

by:PhotoMan2000
ID: 30029909
Thanks I'll give WAMP a try and uninstall the others.
I'll get back to you on this shortly..

0
 
LVL 4

Expert Comment

by:conticreative
ID: 30055311
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
 

Author Closing Comment

by:PhotoMan2000
ID: 31711600
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

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

607 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question