Senin, 21 Maret 2016

Propel Error

Propel will behave erratic if the Foreign Key in the database is invalid.

Return no Error Messages, just go blank

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:

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
  1. Microsoft Visual C++ redistributable file version 2012, the version used 32bit or 64 bit is depend to the OS version.
  2. ODBC MS SQL Server 2012 , the version used 32bit or 64 bit is depend to the OS version.
  3. 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);
?>