PHP
downloads | documentation | faq | getting help | mailing lists | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Настройка во время выполнения> <Установка и настройка
Last updated: Fri, 28 Nov 2008

view this page in

Установка

Используя директиву --with-mysql[=DIR] вы можете включить в PHP поддержку СУБД MySQL.

В PHP 4, директива --with-mysql включена по умолчанию. Чтобы отключить её, используйте директиву конфигурации --without-mysql. Кроме того, в PHP 4, при включении директивы без указания пути к папке установки MySQL, PHP будет использовать встроенную библиотеку MySQL-клиента. В Windows специальные DLL отсутствуют, клиент всегда встроен в PHP4. При использовании приложений использующих MySQL (к примеру, auth-mysql) не стоит использовать встроенную библиотеку -- укажите путь к папке установки MySQL, что будет выглядеть примерно так: --with-mysql=/path/to/mysql. Это заставит PHP использовать библиотеку, установленную MySQL, что позволит избежать любых конфликтов.

В PHP 5 поддержка MySQL больше не включена по умолчанию, кроме того в нём отсутствует встроенная библиотека-клиент. Подробнее о причине можно прочитать в FAQ.

Расширение работает с MySQL версий >= 4.1.0, но не эксплуатирует всю возможную функциональность этих версий. Для этого используйте MySQLi.

Внимание

Сбои в работе PHP могут иметь место при загрузке совместно этого расширения и расширения для работы с библиотекой GNU Recode. За дополнительной информацией обращайтесь к разделу о расширении для recode.

Замечание: Если вам требуется поддержка кодировок (отличных от latin, установленной по умолчанию), вам придётся установить внешнюю библиотеку, скомпилированную с их поддержкой.



add a note add a note User Contributed Notes
Установка
admin at kobashicomputing dot com
02-Nov-2008 12:02
Unfortunately this one bit me for a good half day.

Placing libmysql.dll in the php/ext directory did not work. I tested this under 5.6.2. You need to have it somewhere in the PATH or in SYSTEM or SYSTEM32. But to me this is very silly to force the user to have to setup environment variables or move DLLs around. It shouldn't have to go that far and be the responsibility of the setup program and/or developer.

I really think this issue could be solved doing this:
1) Installer/distribution bundle all three files together under one directory (ext) - php_mysql.dll/php_mysqli.dll/libmysql.dll

2) Developer goes into php_mysql.dll/php_mysqli.dll and in DllMain() on DLL_PROCESS_ATTACH:
  LoadLibrary ("./libmysql.dll");

Then you don't have to deal with this problem and neither do your users.

Kerry Kobashi
rogerc at clubsites dot net
20-Jul-2008 07:05
This error also occurs if the windows path entry for an older version of MYSQL appears before the path entry for a late version of php.  In which case the version of libmysl.dll in the MySQL bin directory will be found before the one bundled with php.  Reversing the system path entries so php is first fixes this problem.  e.g.
PATH= ...  c:\php;C:\Program Files\MySQL\MySQL Server 4.1\bin
Mahesh
13-Jun-2008 02:37
In windows systems, the error "unable to load dynamic library php_mysql.dll" also happens if there's an old version of the file libmysql.dll in the "windows\system32" folder.
jonnus
12-May-2008 05:42
In windows systems, the same error "unable to load dynamic library php_mysql.dll" will happen, if there's an old version of the file in the "windows\system32" folder.
Either remove it or update it.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites