Installing MSSQL Module for PHP on Mac OS X

来源:互联网 发布:java写一个表格 编辑:程序博客网 时间:2024/05/19 13:09

http://blog.benjaminwalters.net/?p=10


Installing the MSSQL module for Mac OS X

Install FreeTDS

  • Create the directory /usr/local/freetds
  • Download the latest version of freetds (http://www.freetds.org/software.html)
  • Open a terminal window
  • Untar/zip the freetds file and cd into that directory in terminal
    • i/e cd ~/Downloads/freetds-0.82
  • paste this in terminal
    ./configure --prefix=/usr/local/freetds --sysconfdir=/usr/local/freetds/conf/freetds --disable-libiconv --disable-odbc
  • type “make “and press enter
  • type “sudo make install “and press enter
    • Enter your password
  • You’re done with freetds…..

Compile PHP

  • Download and untar/zip the latest source (http://php.net/downloads.php)
  • Cd into the php directory in terminal
    • i/e cd ~/Downloads/php-5.3.6
  • Configure PHP
    • Type “./configure” and press enter
  • Type “make” and press enter
  • Go into the mssql extension directory
    • i/e cd ~/Downloads/php-5.3.6/ext/mssql
  • phpize it! (type phpize)
  • Configure mssql to run with freetds
    • Type
      ./configure --with-mssql=/usr/local/freetds

      and press enter

  • Type “make” and press enter
  • Open finder and go to the mssql module directory (~/Downloads/php-5.3.6/ext/mssql/modules/)
  • Copy mssql.so to the extension directory of your php installation
    • MAMP on my machine is located here /Applications/MAMP/bin/php/php-5.3.6/lib/php/extensions/no-debug-non-zts-20090626/
    • Paste the mssql.so into this folder (there should be a bunch of other .so files)
  • Go up a few directories to /Applications/MAMP/bin/php/php-5.3.6/conf/php.ini and open it.
  • Search for “extension=”
  • Paste “extension=mssql.so” on the line below the other extensions
  • Restart MAMP!

Test it!!!!!


0 0
原创粉丝点击