📜 ⬆️ ⬇️

Set pdo_mysql to PHP on Mac OS X 10.5

Apache and PHP are installed by default on Mac OS Leopard. There are enough instructions for enabling php without me.

However, one of the problems remains that Apple, for some reason, did not include a driver for working with mysql via PDO in the standard package, because of this, an attempt to connect to mysql via PDO leads to the error " could not find driver ".

Most of the howto, which I saw, are reduced to assembling this module manually.
But Mac OS is not Gentoo for you. On the way of assembly, there can be many various difficulties, such as: the absence and incompatibility of modules, which will also have to be solved manually, therefore I considered this option last.

image
')
And rightly so. As it turned out everything was already stolen before us everything can be solved more easily. There is an excellent MAMP package containing Mysql, Apache and PHP. Such an analogue of XAMPP or Denwer . MAMP comes in two versions, one of which is free.

All subsequent actions will require administrative privileges.

We put the package. Copy all the pdo_mysql. * Files from the folder
/ Applications / MAMP / bin / php5 / lib / php / extensions / no-debug-non-zts-20050922
to folder
/ usr / lib / php / extensions / no-debug-non-zts-20060613 /


The number in the name of the last folder may vary. For PHP4, everything should be done in the same way.
Optionally, pdo_pgsql. * For PostrgeSQL are also copied, respectively.

After that, it remains to replace the php module itself by copying it from
/ Applications / MAMP / bin / php5 / bin / php
at
/ usr / bin / php


Just in case, make a backup copy of the original / usr / bin / php.

image
Crosspost from personal blog

Source: https://habr.com/ru/post/57965/


All Articles