Installation help

 
 
Picture of Sary Huang
Database Driver Problem MySQLi Error
 

 I am running Moodle test environment on Window Vista having PHP 5.2.10 and MySQL 5.1.36-Community.  When I upgrade from Moodle 1.9.9 to 2.0, I am getting the following error. 

Error: database driver problem detected

The site administrator should verify server configuration

PHP has not been properly configured with the MySQLi extension so that it can communicate with MySQL. Please check your php.ini file or recompile PHP. MySQLi extension is not available for PHP 4.

 I also tried to change the dbtype='mysqli' in config.ini and still see same error.

I would really appreciate if you can provide some suggestion to resolve this error.

Thank you in advance.

Sary

 
Average of ratings: -
Picture of Alberto Ferreira
Re: Database Driver Problem MySQLi Error
 

I have exactly the same erro

 

Please help

 
Average of ratings: -
Picture of Tina Schaefer
Re: Database Driver Problem MySQLi Error
 

Hi there,

I got the error as well and it took me a while to figure it out. Basically you need to add an extension to PHP.

The following solution fits to a Microsoft Windows Server 2003 running Apache and MySQL.

Find out where your PHP folder is located on the server that Moodle is running on. It is usually at C:\PHP.

Open php.ini. Within the file you will find ;extension=php_mysqli.dll. Delete the semicolon. Save the file.

Restart Apache and go to your Moodle website. The error should not show anymore.

Best Tina

 
Average of ratings: -
Picture of Sary Huang
Re: Database Driver Problem MySQLi Error
 

Tina, thank you for your valuable suggestion. I added below to php.ini and restarted the Apache and still have the error.

[PHP_MYSQLI]

extension=php_mysqli.dll

The above two line was not there to uncomment in php.ini, so I added at the end of the file. Also, I verified the extension file php_mysqli.dll is phyically there under c:\php\ext I am running php 5.2.10. What version of php are you using? Do you have any other suggestion that could resolved this error.

Thank you in advance.

Sary

 
Average of ratings: -
Picture of Alberto Ferreira
Re: Database Driver Problem MySQLi Error
 

Thanks for you Help. But didn't work

 
Average of ratings: -
Picture of Peter Kupfer
Re: Database Driver Problem MySQLi Error
 

How do you do this if you aren't in charge of your server?

 
Average of ratings: -
Picture of Chad Parsons
Re: Database Driver Problem MySQLi Error
 

On my hosted server I was not able to locate a .ini file.    Adding a php.ini did not seem to take effect.   (I am using valuehost.ca).  However I requested a change that would normally be in the file (the mysqli extenstion reference) and then added it for me.  Moodle is now up and working.  Hope this helps.

 
Average of ratings: -
Picture of Gayle Baugh
Re: Database Driver Problem MySQLi Error
 

I'm trying to install Moodle 2 on Windows Server 2008 with php v. 5.3.5 and mysql v. 5.5. I got the error. However, the line you mention, ;extension=php_mysqli.dll, is not in the php.ini file. I, too, tried to add the lines:

[PHP_MYSQLI]
extension=php_mysqli.dll

to the bottom of the php.ini and saved it and did IISReset and that didn't work, so I removed the lines, did IISReset again. Now, my error is different. I get

cannotcreatedb in red at the bottom of the page and at the top of the page is the message:
Warning: mysqli::close() [mysqli.close]: Couldn't fetch mysqli in C:\inetpub\wwwroot\lib\dml\mysqli_native_moodle_database.php on line 336
 
Average of ratings: -
Picture of Jaymin Sharma
Re: Database Driver Problem MySQLi Error
 

Hi Tina,

Your solution is good but this is only for localhost.

i got this error on live server so how to fix it.

 

please help me.

thanks

JAY

 
Average of ratings: -
Picture of Dick Taytor
Re: Database Driver Problem MySQLi Error
 

Sary,

Do you mean you changed dbtype    = 'mysqli' in config.php? There's a php.ini file, but the config file is .php - unless renaming it config.ini is a requirement for Windows.

Brian

 
Average of ratings: -
Picture of Sary Huang
Re: Database Driver Problem MySQLi Error
 
Brian, Yes, I meant config.php in Moodle. Sary
 
Average of ratings:Useful (1)
Picture of Alberto Ferreira
Re: Database Driver Problem MySQLi Error
 

I edit the config.php but I didn't find the entry  dbtype    = 'mysqli',

 

I am using php 5.2.13

 

What can be my problem Sary?

 
Average of ratings: -
Picture of Sary Huang
Re: Database Driver Problem MySQLi Error
 

Alberto,

You may want to turn on the debug to Developer level while in 1.9 and then upgrade so that you can see the debug detail issue.

I believe PHP 5.2.13 doesn't come with MySQLi driver.   You can either recompile php with MySQLi option or upgrade your PHP to 5.3.  I resolved my issue by  upgrade PHP to 5.3.3.  Then ran into other issue with duplicate key update and fix data in db.

Sary

 
Average of ratings: -
Picture of Alberto Ferreira
Re: Database Driver Problem MySQLi Error
 

Thanks for your Help. I will try.

 

 
Average of ratings: -
Picture of chris newton
Re: Database Driver Problem MySQLi Error
 

Hi,

It appears most of the postings in this thread are directed at Windows users.  I'm using the latest Fedora linux with the following versions:

 

mysql version:

[root@vvms]/etc/httpd# mysqladmin --versionmysqladmin  Ver 8.42 Distrib 5.1.52, for redhat-linux-gnu on x86_64

php version:

[root@vvms]/etc/httpd# php -vPHP 5.3.3 (cli) (built: Jul 22 2010 15:35:56)Copyright (c) 1997-2010 The PHP GroupZend Engine v2.3.0, Copyright (c) 1998-2010 Zend

apache version:

Technologies[root@vvms]/etc/httpd# /usr/sbin/apachectl -vServer version: Apache/2.2.17 (Unix)Server built:   Oct 27 2010 10:04:21

 

and I'm getting the same error.  The error happens in the web configurator.   I've spent significant time trying to tweak anything and follow any of the above directions.

Any recommendations appreciated.

 

Error:

Error: database driver problem detected

The site administrator should verify server configuration

PHP has not been properly configured with the MySQLi extension so that it can communicate with MySQL. Please check your php.ini file or recompile PHP. MySQLi extension is not available for PHP 4.

 

thanks,

Chris

 
Average of ratings: -
Picture of chris newton
Re: Database Driver Problem MySQLi Error
 

Sorry for the bogus post.  I did not realize there was a "moodle" package in Fedora.  Problem solved.  It pulls a bunch of necessary dependencies that I was missing:

yum install moodle

That was too easy.

 
Average of ratings: -
Picture of 輝 小
回應: Re: Database Driver Problem MySQLi Error
 

by the way, if someone use centos, you need to update  to php53

yum remove php*

yum install php53*

 

 
Average of ratings: -
Picture of Shakir Hussain
Re: 回應: Re: Database Driver Problem MySQLi Error
 

Great tip, i did it & my problem resolved..

 

Thanks u so so so much for ur lovely tip.

 its save my lot of time.

 

God bless u alot.

 regards.

 

Shakir 

 
Average of ratings: -
Picture of Alberto Ferreira
Re: Database Driver Problem MySQLi Error
 

I try change the config,ph,

 

I changed the var $dbtype = 'mysqli'; to var $dbtype = 'mysql'; and now I got the next error

Error: database driver problem detected

The site administrator should verify server configuration

Unknown driver native/mysql

 

What to do???? Help

 
Average of ratings: -
Picture of Tina Schaefer
Re: Database Driver Problem MySQLi Error
 

Hi there,

I am using PHP 5.3. I thought it would be best to upgrade to the latest version.

I used this page http://windows.php.net/download/ to download the latest PHP and followed this guide: http://www.php.net/manual/en/install.windows.manual.php to install it.

I tried using $dbtype='mysql' as well but Moodle 2.0 won't let you for some reason. Try to upgrade to the latest PHP and stick with $dbtype='mysqli'.

Hope this solves your issue.

Best Tina

 
Average of ratings: -
Picture of Sary Huang
Re: Database Driver Problem MySQLi Error
 

Hi, Tina

Thank you very much!!!  I upgraded to PHP 5.3.3 and error went away.  Problem solved.

Sary

 
Average of ratings: -
Picture of kavitha pazhanee
Re: Database Driver Problem MySQLi Error
 
Hi, I am trying to upgrade my moodle version from 1.9 to 2.0.7 in redhat linux. I am getting the same error as Error: database driver problem detected The site administrator should verify server configuration PHP has not been properly configured with the MySQLi extension so that it can communicate with MySQL. Please check your php.ini file or recompile PHP. MySQLi extension is not available for PHP 4. i have PHP version 5.2.10 and mysql version as 5.1.40. i tried uncommenting the following lines from /usr/local/lib/php.ini extension=php_mysql.dll extension=php_mysqli.dll still the same error. can anyone help me to resolve the issue please. Thanks in advance! Regards, Kavitha pazhanee
 
Average of ratings: -
Picture of Ken Task
Re: Database Driver Problem MySQLi Error
Group Particularly helpful Moodlers

more /etc/redhat-release shows specific information about Red Hat (or CentOS)

Verify that you are indeed running 5.2.10: php -v will show.

Might check /etc/php.d/ for the existence of .ini files.  On a CentOS 5.x server (closely related to Red Hat Enterprise 5.x) there are two such .ini files related:

mysqli.ini
mysql.ini

They load their respective extensions: mysqli.so and mysql.so

To check to see that they are loaded:

php -m

will list all extensions loaded and one should see both.

The php.ini file is most normally in /etc/.  Any change in php.ini requires restart of Apache:

/sbin/service httpd restart

Check /var/log/httpd/error_log for errors

Two other items:

'which php' will show which php would be used

and the following will find all locations of php.ini files:

find / -name php.ini

Above command will take a long time to complete as it's searching your entire drive for any file by that name.

There is a Tracker item:

http://tracker.moodle.org/browse/MDL-17399

Did you acquire ALL of the version 2 you are trying to use? (any missing files?)

'spirit of sharing', Ken

 
Average of ratings: -
Picture of kavitha pazhanee
Re: Database Driver Problem MySQLi Error
 

Hi,

  Thanks for your reply.

i tried more /etc/redhat-release in my linux machine and i got the version to be red hat enterprise release server version 5.2

As in the above posts, i tried upgrading the php version to 5.3.9. So php -v command is giving me with the version of 5.3.9

my /etc/php.d folder doesnt contain any files. I was able to see a single php.ini file in my /usr/local/lib. and when i uncomment the extensions for mysql,mysqli and pdo_mysql, i am getting warning as

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/php_mysql.dll' - /usr/local/lib/php/extensions/no-debug-non-zts-20090626/php_mysql.dll: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/php_mysqli.dll' - /usr/local/lib/php/extensions/no-debug-non-zts-20090626/php_mysqli.dll: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/php_pdo_mysql.dll' - /usr/local/lib/php/extensions/no-debug-non-zts-20090626/php_pdo_mysql.dll: cannot open shared object file: No such file or directory in Unknown on line 0

and the warning goes of when semicolon exists before the extensions in php.ini file.

and php -m comand shows me with mysql and pdo_mysql in the modules list but mysqli is missing. please help me in resolving this issue.

Regards,

kavitha pazhanee

 
Average of ratings: -
Picture of Ken Task
Re: Database Driver Problem MySQLi Error
Group Particularly helpful Moodlers

semi-colon in front of a line item in php.ini is commenting it out - ie, PHP won't use that item.

When you upgraded to php 5.3.9, did you acquire from the RedHat Network and ALL the extensions?

yum list php53*

will show what is installed and what is available.

If your version 1.9 of Moodle is still up and functioning, what does Site Admin -> Server -> PHP Info show in relationship to the build and extensions loaded, etc.  It will show which php.ini is being used.

In past upgrades to php, can re-call running into an issue with loading mods and it reported the same 'on line 0' error.  It was a depreciated mod now included in core PHP and the fix was to change the name of the /etc/php.d/X.ini file so it would not load.

On a RedHat Enterprise Linux server, I can find NO .dll's related to PHP and no lines that refer to .dll files in php.ini.  But, those servers are pretty much stock Linux with no added extentions for such things as Front Page.

Missing .so file is strange.  Shouldn't be missing.

Might want to review how and what was installed with the upgrade to PHP.

'spirit of sharing', Ken

 
Average of ratings: -
Picture of kavitha pazhanee
Re: Database Driver Problem MySQLi Error
 

yes,even i came to know that semicolon is used to comment the lines in php.ini file. I upgraded php with ./configure command as below, as yum command was not working for my system

./configure --with-apxs2=/usr/local/apache/bin/apxs --with-curl --with-ldap --with-gd --enable-mbstring --enable-exif --with-mysql=/usr/local/mysql/ --with-mysql-sock --with-openssl --enable-pdo --with-pdo-mysql --enable-soap --with-xmlrpc --with-gettext --with-gdbm --enable-ftp --enable-magic-quotes --with-mime-magic

My existing moodle navigation to php shows PHP Version 5.3.9, loaded configuration file as usr/local/lib/php.ini and Configure Command as './configure' '--with-apxs2=/usr/local/apache/bin/apxs' '--with-curl' '--with-ldap' '--with-gd' '--enable-mbstring' '--enable-exif' '--with-mysql=/usr/local/mysql/' '--with-mysql-sock' '--with-openssl' '--enable-pdo' '--with-pdo-mysql' '--enable-soap' '--with-xmlrpc' '--with-gettext' '--with-gdbm' '--enable-ftp' '--enable-magic-quotes'

libphp5.so file is available /usr/local/apache/modules

am i missing something in installation?

 
Average of ratings: -
Picture of john michel
Re: Database Driver Problem MySQLi Error
 

i think you should change database driver in phpmyadmin,

i hope you get the sollution.

 
Average of ratings: -
Picture of kavitha pazhanee
Re: Database Driver Problem MySQLi Error
 

Hi,

i am not able to find anything in the name of phpmyadmin in my linux machine. Can you please tell me on how to do that.

 
Average of ratings: -
Picture of kavitha pazhanee
Re: Database Driver Problem MySQLi Error
 

Hi,

 Thanks to all. It worked finally. While installing php i missed to configure mysqli extension that was the issue creating one. After recompiling with the mysqli extension it worked.

Steps for starters if they find issue like me. when you get an error as above in Redhat linux

1. go to the php unzipped file location. For example if you unzipped your .tar file in /root

cd /root/phpfoldername

then use the command ./configure --help

it shows all the available extensions for php you installed. as the error says mysqli extension is missing, copy the following extensions  --with-mysqli --enable-mysqlnd

and append to the default extensions so your ./configure should be something like this

./configure --with-apxs2=/usr/local/apache/bin/apxs --with-curl --with-ldap --with-gd --enable-mbstring --enable-exif --with-mysql=/usr/local/mysql/ --with-mysql-sock --with-openssl --enable-pdo --with-pdo-mysql --enable-soap --with-xmlrpc --with-gettext --with-gdbm --enable-ftp --enable-magic-quotes –with-mysqli –-enable-mysqlnd

after successfull configuration use "make" and "make install" command. After successful make restart apache and the issue will be gone!

 

Regards,

kavitha

 
Average of ratings: -
Picture of Ken Task
Re: Database Driver Problem MySQLi Error
Group Particularly helpful Moodlers

Glad you've resolved the issue and thanks for posting solution.

For future issues, might check into acquiring packages from public yum repositories
Definitely READ: http://iuscommunity.org/About
http://iuscommunity.org/Repos

'spirit of sharing', Ken

 
Average of ratings: -
Picture of Benjamin Gee
Re: Database Driver Problem MySQLi Error
 

This is how I fixed the error while installing 2.2 on a centOS server

Click on exhaustive options list in "easy apache"

Enable MSQLi

Recompile.

Done.

 
Average of ratings: -
Picture of Mahesh Patil
Database Driver Problem MySQLi Error
 

I am trying to install moodle on my website not on local host and i am getting this error

please help me out


Error: database driver problem detected

The site administrator should verify server configuration

PHP has not been properly configured with the MySQLi extension so that it can communicate with MySQL. Please check your php.ini file or recompile PHP. MySQLi extension is not available for PHP 4.

 
Average of ratings: -
Picture of Ken Task
Re: Database Driver Problem MySQLi Error
Group Particularly helpful Moodlers

Specifics to server please … operating system, php version, etc..
and the version of Moodle you are attempting to install.
The error shows PHP version 4.

If attempting to install Moodle 2, no can do … requires php version 5.3+

If on Linux logged on as root user:
php -v will show version
php -i |grep mysqli will show if php has been compiled with mysqli support.

'spirit of sharing', Ken

 
Average of ratings: -
Picture of Mahesh Patil
Re: Database Driver Problem MySQLi Error
 

all is right because i checked connectivity of php and mysql using code and it shows it is connected.

and at the time of installation this error is continuously coming

 
Average of ratings: -
Picture of Ken Task
Re: Database Driver Problem MySQLi Error
Group Particularly helpful Moodlers

Not a Moodle programmer ... just an experienced user ... and know that there are differences in platform that require similar but slightly different approaches to resolving problems.  CentOS 5.x series, as an example, won't show a php-mysqli as being a compile/build switch because support for mysqli is built into php-mysql.  The only way one could see if support was there was to use php -i |grep mysqli.

Now you may not run CentOS nor any RedHat flavored server so that tip may/may not help you at all.  That's why the request for some additional server information.

Obviously, however, the fact that it reports PHP version 4 doesn't provide support for mysqli is true.  PHP version 4 did not have mysqli.  That could mean the system upon which you are installing has a default to use PHP version 4 first but one might be able to point Moodle to a newer required version of PHP.  One way to see that is from the command line with: which php and then php -v

Could be you are on a remotely hosted system with no ssh/command line access so that tip is also useless to you.  But, in control panels, etc. of your remotely hosted system there might be buttons that show the version of PHP and might also provide a way for you to use a higher version of PHP for Moodle.

So ... bottom line, since I've installed oodles of Moodles on stand alone (not remotely hosted shared systems) CentOS 5.x, Ubuntu LTS, and RedHat Enterprise 5.x systems with no such issues, I can only try to help find where the problem resides by sharing my experiences and asking questions.  No info, however, it becomes a total guess and might be a total waist of your time and mine!

'spirit of sharing', Ken

 
Average of ratings: -
Picture of Simon Bryan
Re: Database Driver Problem MySQLi Error
 

Hi Ken,

Late to the party here, but you may be able to help. Having the same issue here with CentOS6, using your info I can see I can stop trying to download and install msqli!! Checked with php -i and it was compiled with php, the section in the php.ini file has all the items uncommented. But I cannot find an mysqli.so, should I have one, or is that what is built into mysql.so?

The strange thing si that when I set this up yesterday, it was all working even started to configure and chose the Afterburner theme as a starting point, logged ina again later and I now get this error.

Any thoughts?

 
Average of ratings: -
Picture of Ken Task
Re: Database Driver Problem MySQLi Error
Group Particularly helpful Moodlers

@Simon - boy this thread is confusing ... started with a Windows issue then morphed into Linux and CentOS

Try php -m |grep mysql

You should see output that shows:

mysql
mysqli

In /etc/php.d there should be a mysqli.ini AND a mysql.ini.  Any .ini in /etc/php.d/ is loaded and no need to have same references in the /etc/php.ini file.

[root@elearning php.d]# cat mysqli.ini
; Enable mysqli extension module
extension=mysqli.so

[root@elearning php.d]# cat mysql.ini
; Enable mysql extension module
extension=mysql.so

There should be a mysql.so

On a 64 bit box:

/usr/lib64/php/modules/mysql.so

One can check for existence of php5-mysql via yum:

yum list php-mysql

will show:

Installed Packages
php-mysql.x86_64                                       5.3.3-14.el6_3                                        @rhel-x86_64-server-6

If installed.

yum list php-*

Will show all modules installed and available.

If it was working and not now that's strange.

'spirit of sharing', Ken

 
Average of ratings: -
Picture of Simon Bryan
Re: Database Driver Problem MySQLi Error
 

Brilliant!!

php -m |grep mysql - something about Magic Quotes not supported

php -m - read list - no Mysql or Mysqli!! Try yum install php-mysql

Restart Apache - Bingo, working again!!!

Thanks for that!

Not sure what happened, can't see anyhting in the logs, I had been yumming all monrning, including --distribution-synchronisation, whic downgraded PHP, and wanted to downgrade MySQL but failed with a conflict.

I then used Webmin and Yum to delete all remaining MySql packages and did a yum install MySql (this tiime not from the 'Remi' repository) It gave me MySQL 5.1.6, instead of the more up to date 5.5.

That is where I was when your email came in and realised I had not even checked that php-mysql was loaded.

Thanks again, a very frustrating 24 hours, b ut has ramped up my Linux skills again. smile

 
Average of ratings: -
Picture of Ken Task
Re: Database Driver Problem MySQLi Error
Group Particularly helpful Moodlers

Glad it's working!

But ... 'something about Magic Quotes not supported' is not necessarily good.  What did it say?

When one starts using other repos to make up for what CentOS doesn't provide it can get you in trouble.  Most all of your updates should come from CentOS upstream, not remi.  In this case the only thing of interest at remi is MySQL.

How to avoid that ... by default, the remi repo is set to active.  So make it 'inactive' by default:

cd /etc/yum.repos.d

nano remi.repo

change enabled=1 to enabled=0

Now when updating the OS with yum -y update remi won't be checked

When needing to check for an upgrade to MySQL:

yum --enablerepo=remi update mysql-server mysql mysql-libs

And two last yum tips ... if one needs to check what yum will install/update, never use the -y option.  If you leave that off yum will pause showing all that it will update and ask y/n.

One can also exclude dependencies:

yum --enablerepo=remi --exclude=php* update mysql-server mysql mysql-libs

Yum will pause showing what it will install/upgrade.  If not correct, press 'n' [ENTER] and try command again with different options.

Could add exludes in the remi.repo file itself to protect PHP.

exclude=php*

BTW, since you've mentioned Webmin, one could make Custom Command 'buttons' of yum commands so one doesn't have to try to remember all the switches/options once a yum command is tested and is behaving as desired.

Webmin also a great tool to schedule Moodle cron jobs via php, wget, or curl and backup databases with a daily SQL dump - date/time stamped, as well as site backups of Moodle consisting of web root + data directory tar balls.  Not only that, but git updates within a series as well.

'spirit of sharing', Ken

 
Average of ratings: -
Picture of Simon Bryan
Re: Database Driver Problem MySQLi Error
 

Ok, just checked again and they do work but....

PHP Warning: Directive 'magic_quotes_gpc' is deprecated in PHP 5.3 and greater in Unknown on line 0
PHP Warning: Directive 'magic_quotes_sybase' is deprecated in PHP 5.3 and greater in Unknown on line 0

Yep was using the --enablerepo switch fro Remi so it is not in the normal update path

The only time I use -y is updating the OS and know I want the latest of everything. yum, apt-get etc have made me lazy I think, no cycle of download, unpack, configure and build to keep me amsused anymore

I think things started to fall into place after I did the yum --distribution-synchronisation

PS The second good thing out of this = nano, had totally forgotten it and have been using vi !

Cheers

Simon

 
Average of ratings: -
Picture of Ken Task
Re: Database Driver Problem MySQLi Error
Group Particularly helpful Moodlers

Sorry ... seem to be 'lecturing' here when I don't need to be! :\

/etc/php.ini

magic_quotes_gpc = Off
magic_quotes_runtime = Off
magic_quotes_sybase = Off

'spirit of sharing', Ken

 
Average of ratings: -
Picture of Daniel Thomas
Same Database Driver Problem MySQLi Error
 

Hello friends,

I have already spent several days attempting to install Moodle 2.4.1 on a local computer running CentOS 5.8, with PHP Version 5.3.3

I am facing the same problem, the installation doesn't progress after the database connection; it outputs the same error message:

PHP has not been properly configured with the MySQLi extension so that it can communicate with MySQL.

I've tried so many things...

First thought it might be a difficulty related to Moodle version, so I tried with Moodle 2.2 and even with Moodle 1.9.9, always with the same problem.

Then I thought that maybe using PostgreSQL it would be alright, but nope... same problem! (just a minor change in the error message)

I have visited forum threads and tried many of the recommended solutions that have worked for others, with no success for me!

I have edited the PHP.INI file to add the extensions, no success.

Something interesting, it seems that the mysqli.dll file is not present in my computer. I tried downloading it and then putting it where I assumed it should be, but it didn't work either.

One of the last threads suggested editing the mysql.ini and mysqli.ini files... to my surprise, I searched for those files and also discovered that they are not present in my computer either.

Nevertheless, I have indeed installed mysql and mysql-server. I also installed postgre and postgre-server... how could it be, that there isn't a mysql.ini of mysqli.ini file in my computer?

Some other thread suggested using the ./configure command to recompile PHP, but maybe that wasn't CentOS... I haven't been able to use such command, the system indicates that it doesn't exist.

So, by this time...
I'm desperate !!! PLEASE HELP !!!         PLEASE !!!

Maybe Ken in his wonderful spirit of sharing might be able to help me, I can see that the solutions he suggested have indeed helped other people with the same issue...

PLEASE !!????

 
Average of ratings: -
Picture of Ken Task
Re: Same Database Driver Problem MySQLi Error
Group Particularly helpful Moodlers

@Daniel ...

CentOS 5.8 and higher in a typical install of php has all the 'drivers' needed (php-mysql and php-mysqli - actually mysqli is include in the mysql driver).  A CentOS server's php.ini file, BTW, shouldn't show any .dll's (that's a Windows php.ini).

So let's backtrack here a little ... how was php installed?  How is the site hosted?  Shared or VPS or standalone?

Could be as simple as a yum command to update php with all the appropriate extensions and removal of an errant php.ini file meant for Windows.

'spirit of sharing', Ken

 
Average of ratings:Useful (1)
Picture of Daniel Thomas
Re: Same Database Driver Problem MySQLi Error
 

Thank you so very much Ken and Howard for your kind response!

 

For some reason, the whole mysqli package is missing; for example, the output of phpinfo(); doesn't show the word mysqli in any place...

The problem might seem to be in the respository?
What happens is that when I try yum search php53-mysqli, or either yum install php53-mysqli, the package is not found...

apparently everything else was updated indeed to PHP 5.3.3

might there be some repository that I might try adding, in case it helps?

PURA VIDA

(Costa Rican Greeting)

Daniel Henry

 
Average of ratings: -
Picture of Ken Task
Re: Same Database Driver Problem MySQLi Error
Group Particularly helpful Moodlers

With CentOS 5.8, which mirrored RHEL 5, the php version available from CentOS repos were less than what was required.  Third party repo need to aquire 5.3.x of php with all extensions.

One could acquire from epel repos.

Tip: when setting up that repo make sure it is defaulted to 'disabled' ... before using.  It might confuse the system if leaving active.  This does mean one needs to enable it on the fly using:

yum --enablerepo=epel list php53* php53-*

One just needs to acquire php53 and extensions ... not all the other stuff that might be available.

BTW, CentOS 5 is now at 5.9.

Consider updating the entire system first before going after php53 with the epel repo.

If ya need it: http://www.thegeekstuff.com/2012/06/enable-epel-repository/

Here's one difference in platform ... with CentOS/RHEL one just needs to acquire php53-mysql (mysqli comes included).  As you have discovered, there is no php53-mysqli - separate.

After acquiring, might consider immediately increasing some values in php.ini then.  And, apache would have to be restarted to pick up on changes to PHP. ;)

'spirit of sharing', Ken

 
Average of ratings: -
Picture of Howard Miller
Re: Same Database Driver Problem MySQLi Error
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers

Yep - you've been following the instructions for Windows which is completely different.

Your solution is probably just (as the root user)...

yum install php-mysqli

...then restart the web server.

 
Average of ratings: -
Picture of Ali Ahmadian
Re: Same Database Driver Problem MySQLi Error
 

Thanks Howard Miller ,

I had the same problem and your comment worked for me.

OS=Centos 6.3

PHP=5.3.3

 
Average of ratings: -
Toneee.com Canvas Avatar
Re: Same Database Driver Problem MySQLi Error
 

We had the same problem. Since mysqli is already included in mysql, I'm not sure why Moodle can't connect. As with others using CentOS, mySQLi wasn't found; it's probably not required with my version of PHP. I checked phpinfo() using php -i at the command prompt. I also tried using PostgresSQL and it returned the same error, only replacing mySQLi with PostgresSQL related files.

Moodle seemed never this hard to install. What gives? Is there a definitive CentOS thread on how to install Moodle using CentOS?

SPECS: We're using the following:

  • VPS server (GoDaddy reseller)
  • CENTOS 6.4 x86_64 virtuozzo
  • php 5.3.26
  • mySQL 5.5.32
  • cPanel 11.38.2 (build 6)
 
Average of ratings: -
Picture of Ken Task
Re: Same Database Driver Problem MySQLi Error
Group Particularly helpful Moodlers

@Tone

Have no issues with *standalone* CentOS 6.4 with mysql or mysqli.  mysqli is an improvement (the 'i') over mysql so they are not really the same.  One installs php-mysql one should also get php-mysqli with Cent. as they are both in the rpm package.

rpm package contents:

/etc/php.d/mysql.ini
/etc/php.d/mysqli.ini
/etc/php.d/pdo_mysql.ini
/usr/lib64/php/modules/mysql.so
/usr/lib64/php/modules/mysqli.so
/usr/lib64/php/modules/pdo_mysql.so

Fact is, you are using a machine built by GoDaddy.  There are no rules as to what/how one might build a box.

See if there is a mysql.ini AND a mysqli.ini in /etc/php.d/ directory.

Also check for the .so files for both.  Located in /usr/lib64/php/modules/

Had to use remi repo to get higher version of MySQL as base for CentOS was 5.1.69.

What's in your repo list: yum repolist

I take it that the VPS package does include mysql on localhost.  MySQL running?

'spirit of sharing', Ken

 
Average of ratings: -
Picture of Vivek mahadevan
Re: Same Database Driver Problem MySQLi Error
 

Hello everyone,

I'm facing the same problem as described

Error: database driver problem detected

The site administrator should verify server configuration

PHP has not been properly configured with the MySQLi extension so that it can communicate with MySQL. Please check your php.ini file or recompile PHP. MySQLi extension is not available for PHP 4.

Im using a Ubuntu 12.10 installation, with PHP 5.4.6., along with mysql-server version 5.2.2 Any ideas on how to get around the problem?

 

Thanks a lot for your time!

 

 
Average of ratings: -
Picture of Ken Task
Re: Same Database Driver Problem MySQLi Error
Group Particularly helpful Moodlers

@Vivek:

Have you tried to install php-mysqli via apt-get?  As I mentioned, run CentOS myself and when one installs php-mysql one gets php-mysqli also.  Maybe Ubuntu has them separate in their package management.

Something like: sudo apt-get install php5-mysqli

Check php.ini for loading of extension: extension = mysqli.so

If that is successful in acquiring, restart apache services for the addition/change to php to take affect.

'spirit of sharing', Ken

 
Average of ratings: -
Picture of Vivek mahadevan
Re: Same Database Driver Problem MySQLi Error
 

Thanks for the quick reply Ken!

I tried it but I'm getting the following error

Package php5-mysqli is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  php5-mysqlnd:i386 php5-mysql:i386 php5-mysqlnd php5-mysql

E: Package 'php5-mysqli' has no installation candidate

Any suggestions on which package I should proceed with?

Thanks

 
Average of ratings: -
Picture of Ken Task
Re: Same Database Driver Problem MySQLi Error
Group Particularly helpful Moodlers

Uhhh ... like I said, don't use Ubuntu but CentOS.  However, can Google and did.  See http://ubuntuforums.org/showthread.php?t=821575

According to that forum posting on the topic: php5-mysql

Also, according to that posting, when one checks php with phpinfo, php-mysqli is there or at least support for it.

What is your output of php -m |grep mysql

Shows all modules loaded.  And in the display, one should see both mysql and mysqli.  One just needs minimal so getting anything/everything related to php of the 64 bit version would be ok, I would think.   So, getting php5-mysqlnd wouldn't hurt!

'spirit of sharing', Ken

 

 
Average of ratings: -
Picture of John Andrewartha
Re: Same Database Driver Problem MySQLi Error
Group Particularly helpful Moodlers

You also need to restart your webserver after making any changes to the php.ini or php.conf files, including adding modules.

 
Average of ratings: -
Picture of Vivek mahadevan
Re: Same Database Driver Problem MySQLi Error
 

I ended up installing mysql-lnd. Thanks ! It solved the problem.

 
Average of ratings: -