Wednesday, December 5, 2007

Enabling mysql on local php website

I setup a development instance on my PC of our corporate website today. The website was written in php, with a mysql back-end. I ran into a problem with php talking to mysql. Mysql is not enabled by php out of the box, so here are the steps that I had to follow to enable it:

  1. Verified path to php installation dir ("C:\Program Files\PHP") was in the PATH string
  2. Verified extension dir was set in the "Paths and Directories" Section of php.ini
    1. extension_dir = "C:\Program Files\PHP\ext"
  3. Downloaded supporting mysql dlls
    1. Put libmySQL.dll in the php installation dir
    2. put php_mysql.dll in extension_dir
    3. put php_mysqli.dll in extension_dir
  4. Enabled extension DLL's in the Dynamic Extensions section of php.ini
    1. extension=php_mysql.dll
    1. extension=php_mysqli.dll

No comments: