Selasa, 20 Januari 2015

Install Microsoft's SQL Server Driver for PHP

Instruction notes:

  1. Microsoft's PHP driver for SQL Server only runs with PHP 32-bit builds (as standard from http://windows.php.net/download).
  2. These instructions are only for PHP 5.2, 5.3 or 5.4. (5.5 and 5.6 supported with custom build.)
  3. I am pretending that PHP is installed into folder C:\PHP.  Replace the term C:\PHP in the instructions with whatever folder your PHP is installed into.
  4. See orange text for PHP 5.5 and 5.6 support in 32 and 64 bits.  If you do not know whether you have 64-bit PHP 5.5/5.6, start the instructions at step 5, note the orange comment in 5.3, then return to step 1 of the instructions below.
Instructions:
Download Microsoft's PHP drivers. Open page: http://www.microsoft.com/en-us/download/details.aspx?id=20098
If you have Windows Vista, Server 2008 or above, download SQLSRV30.EXE.
If you have Server 2003/Windows XP or below, download SQLSRV20.EXE

Extract the entire contents of the file downloaded in (1.) to your PHP extensions folder.  This is usually a sub-folder of the location where php is installed, named 'ext', e.g. C:\PHP\ext.
Note that you can use WinRAR to open the .exe file and extract the files, if you want.

Install the SQL Server Native Client downloaded from the previous step (3.) on the same computer that runs PHP.

Go To php.ini and add below lines
  • For SQLSRV30.EXE (or the custom drivers), PHP 5.4, NTS, VC9 add lines:
    extension=php_sqlsrv_54_nts.dll
    extension=php_pdo_sqlsrv_54_nts.dll
  • For SQLSRV30.EXE (or the custom drivers), PHP 5.4, TS, VC9 add lines:
    extension=php_sqlsrv_54_ts.dll
    extension=php_pdo_sqlsrv_54_ts.dll
  • For SQLSRV30.EXE (or the custom drivers), PHP 5.3, NTS, VC9 add lines:
    extension=php_sqlsrv_53_nts.dll
    extension=php_pdo_sqlsrv_53_nts.dll
  • For SQLSRV30.EXE (or the custom drivers), PHP 5.3, TS, VC9 add lines:
    extension=php_sqlsrv_53_ts.dll
    extension=php_pdo_sqlsrv_53_ts.dll
  • For SQLSRV20.EXE, PHP 5.3, NTS, VC9 add lines:
    extension=php_sqlsrv_53_nts_vc9.dll
    extension=php_pdo_sqlsrv_53_nts_vc9.dll
  • For SQLSRV20.EXE, PHP 5.3, NTS, VC6 add lines:
    extension=php_sqlsrv_53_nts_vc6.dll
    extension=php_pdo_sqlsrv_53_nts_vc6.dll
  • For SQLSRV20.EXE, PHP 5.3, TS, VC9 add lines:
    extension=php_sqlsrv_53_ts_vc9.dll
    extension=php_pdo_sqlsrv_53_ts_vc9.dll
  • For SQLSRV20.EXE, PHP 5.3, TS, VC6 add lines:
    extension=php_sqlsrv_53_ts_vc6.dll
    extension=php_pdo_sqlsrv_53_ts_vc6.dll
  • For SQLSRV20.EXE, PHP 5.2, NTS, VC6 add lines:
    extension=php_sqlsrv_52_nts_vc6.dll
    extension=php_pdo_sqlsrv_52_nts_vc6.dll
  • For SQLSRV20.EXE, PHP 5.2, TS, VC6 add lines:
    extension=php_sqlsrv_52_ts_vc6.dll
    extension=php_pdo_sqlsrv_52_ts_vc6.dll
 

Tidak ada komentar:

Posting Komentar