PHP and mysqli "enable"

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

Is it as easy as adding LoadModule line in php.ini? If I need to recompile php, does anyone know of a good link where I could follow this (so I don't do anything)?

Thanks in advance.

+2


source to share


5 answers


Save the headache and install the PHP or MAMP entropy package . Getting all the commonly used PHP modules working with OSX is not trivial. Most people I know come with one of these packages.

Update:



A lot has changed since I originally posted this answer. The easiest OSX task these days is to use Homebrew .

+3


source


PHP.net said :

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



You will need to configure PHP with MySQLi support. Why not take the safe (and probably best) object-oriented way and move on from PDO classes?

+4


source


I was trying to install MediaWiki on Snow Leopard with MySQL 5.1.41, which also needed this. After a lot of stumbling, the solution was very simple ...

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

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

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

As long as I linked /tmp/mysql.sock to / var / mysql it didn't hit until I edited the file.

+3


source


I had the same problem.

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

+1


source


If php5 was compiled with mysqli support, then all you need to do is point to this library in php.ini

extension=mysqli.so

      

After adding that you will probably need to restart apache.

Note. The mysqli library filename may be different on some platforms.

0


source







All Articles