Sabtu, 05 September 2015
Selasa, 12 Mei 2015
Setting wampserver2.5 ( Apache-2.4 Mysql-5.6 php5.5 ) in Windows 7 ultimate with MS SQL Server 2012 Database PDO
The spec I need is, PHP 5.5 with :
a. "clean URL"
b. PHP PDO MS SQL Server 2012
The Windows Version being used is Windows 7 Ultimate
The steps I've done is:
1. installing the WAMP:
a. "clean URL"
b. PHP PDO MS SQL Server 2012
The Windows Version being used is Windows 7 Ultimate
The steps I've done is:
1. installing the WAMP:
- WAMP installer is using the 32 bit version of WAMP 2.5 wampserver2.5-Apache-2.4.9-Mysql-5.6.17-php5.5.12-32b.exe
- Note that 32 bit version is used becasuse the "PHP PDO MS SQL Server 2012" is only supported on 32 bit version
2. Setting the clean URL
- Settings the clean URL means enabling the "rewrite_module"
- To enable the "rewrite_module" could be done from the Wamp Control Panel, the example is on Picture 1
Picture 1. Enabling the "rewrite_module"
3. Installing the PHP PDO MS SQL Server 2012
- To install PHP PDO MS SQL Server 2012 settings require 3 installer
- Microsoft Visual C++ redistributable file version 2012, the version used 32bit or 64 bit is depend to the OS version.
- ODBC MS SQL Server 2012 , the version used 32bit or 64 bit is depend to the OS version.
- PHP PDO SQL for PHP 5.5
- This installer expand the required file "php_pdo_sqlsrv_55_ts.dll" and "php_sqlsrv_55_ts.dll" , into <wamp installation dir>\bin\php\php5.5.12\ext
- After the PHP PDO files is "copied" into <wamp installation dir>\bin\php\php5.5.12\ext , the PHP PDO extension should be enabled , this could be done from the WAMP Control panel, the example is in Picture 2
Picture 2. Adding the PHP extension "php_pdo_sqlsrv_5x_ts.dll" and "php_sqlsrv_5x_ts.dll"
4. Testing
Test the connectivity with the MS SQL Server, set $dbserver, $dbname, $username and $password with you database settings
<?php
$dbserver="127.0.0.1";
$dbname="my_app";
$username="user_myapp";
$password="secret123";
//phpinfo();
$db = new PDO("sqlsrv:Server=$dbserver;Database=$dbname", $username, $password);
?>
4. Testing
Test the connectivity with the MS SQL Server, set $dbserver, $dbname, $username and $password with you database settings
<?php
$dbserver="127.0.0.1";
$dbname="my_app";
$username="user_myapp";
$password="secret123";
//phpinfo();
$db = new PDO("sqlsrv:Server=$dbserver;Database=$dbname", $username, $password);
?>
Langganan:
Postingan (Atom)