PHP and "turning on" mysqli

11,886

Solution 1

Save yourself the headache and install the entropy PHP package or MAMP. Getting all the commonly needed PHP modules working on OSX is non-trivial. Most people I know go with either one of those packages.

Update:

A lot has changed since I originally posted this answer. These days, the most straight forward thing to do on OSX is to use Homebrew.

Solution 2

PHP.net said:

As of PHP 5.0, MySQL support is no longer enabled by default with the standard PHP distributions.

You will need to configure PHP with MySQLi-support. Why don't take the safe (and probably best), object oriented, road and go with the PDO classes?

Solution 3

I was trying to install the MediaWiki on Snow Leopard with MySQL 5.1.41, which needed this as well. After plenty of stumbling around, the solution was extremely simple...

In /etc/php.ini, change the following lines from:

pdo_mysql.default_socket = /var/mysql/mysql.sock mysql.default_socket = /var/mysql/mysql.sock mysqli.default_socket = /var/mysql/mysql.sock

to: pdo_mysql.default_socket = /tmp/mysql.sock mysql.default_socket = /tmp/mysql.sock mysqli.default_socket = /tmp/mysql.sock

While I had linked /tmp/mysql.sock to /var/mysql, this didn't kick in until I actually edited the file.

Solution 4

I have had this same issue.

You need to make sure phpMyAdmin configuration file config.inc.php has the extension pointing to mysqli not mysql which is the default.

Share:
11,886
Anthony
Author by

Anthony

Updated on June 13, 2022

Comments

  • Anthony
    Anthony almost 2 years

    I'm having trouble finding documentation about how exactly to go about "turning on" mysqli. I'm running OS X SL and, as I understand it, since php5 is installed, the mysqli extension should already be there as well.

    Is this as simple as adding a LoadModule line to php.ini? If I need to re-compile php, does anyone know of a good link where I could follow along to do that (so I don't goof anything up)?

    Thanks in advance.