Welocme to PHP CMS Courses and JOB

We are here to help you Learn Basic and Adavanced PHP Concepts, as well as PHP CMS Concepts and working envoirment on CMS. Once you found the way to go with PHP and PHP CMS, you can find the JOB route on this PHP CMS Courses and JOB Blog.

Welocme to PHP CMS Courses and JOB

We are here to help you Learn Basic and Adavanced PHP Concepts, as well as PHP CMS Concepts and working envoirment on CMS. Once you found the way to go with PHP and PHP CMS, you can find the JOB route on this PHP CMS Courses and JOB Blog.

Php Cms Drupal

Welocme to PHP CMS Courses and JOB

We are here to help you Learn Basic and Adavanced PHP Concepts, as well as PHP CMS Concepts and working envoirment on CMS. Once you found the way to go with PHP and PHP CMS, you can find the JOB route on this PHP CMS Courses and JOB Blog.

Php Cms Joomla

Welocme to PHP CMS Courses and JOB

We are here to help you Learn Basic and Adavanced PHP Concepts, as well as PHP CMS Concepts and working envoirment on CMS. Once you found the way to go with PHP and PHP CMS, you can find the JOB route on this PHP CMS Courses and JOB Blog.

Php Cms Wordpress

Welocme to PHP CMS Courses and JOB

We are here to help you Learn Basic and Adavanced PHP Concepts, as well as PHP CMS Concepts and working envoirment on CMS. Once you found the way to go with PHP and PHP CMS, you can find the JOB route on this PHP CMS Courses and JOB Blog.

Pages

Thursday, July 18, 2013

How to Connect PHP with SQL Server from Windows Env using SQLSRV?

Here we are going to install SQLSRV Driver and configure with PHP,

1 - Before Start, Run phpinfo() from your localhost/server, and find your System bit (x86/x64). From my research SQLSRV will work only on Wamp2.2 and x86 Env.
2 - Now open your wamp php.ini, and enter below lines under extension section,
    extension=php_sqlsrv_52_nts.dll;
    extension=php_sqlsrv_52_ts_vc6.dll;
3 - Then download SQLSRV driver from http://www.microsoft.com/en-us/download/details.aspx?id=20098
4 - Run SQLSRV driver and enter your original PHP ext path(E:\wamp\bin\php\php5.3.13\ext) also please make sure the same path given in php.ini file(;extension_dir = "ext"
extension_dir = "e:/wamp/bin/php/php5.3.13/ext/")
5 - Once you successfully installed SQLSRV, please make sure the above given dll files loaded under above PATH.
6 - Its time to restart your wamp server(several times if needed)
7 - Now check with phpinfo(), sqlsrv should be list in your phpinfo information
8 - Then Finally you must download SQLCLIENT for SQLSRV driver from
SQL Server Native Clients are here:
SQL 2012
  http://www.microsoft.com/download/en/details.aspx?id=29065
SQL 2008 R2
  http://www.microsoft.com/download/en/details.aspx?id=16978
SQL 2005
  http://www.microsoft.com/download/en/details.aspx?id=20101
 
 9 - Finally try with below codes from your PHP to test with PHP SQLSRV driver,


 $dbhost = "servername";
 $user = "sq";
 $pwd="xxxx";

$link = sqlsrv_connect($dbhost, $user, $pwd);
if($link === FALSE) {
    echo 'Could not connect';
    die('Could not connect: ' . sqlsrv_errors(SQLSRV_ERR_ALL));
}
echo 'Successful connection';
sqlsrv_close($link);
?>

10. Now your Wamp server start to work with SQLSRV driver.

Wednesday, July 17, 2013

Configure PHP with MSSQL connectivity


To connect PHP to MSSQL, Please check with below stpes

1.       Enable php_mssql.dll in PHP.INI (Throw WAMP services ICON)

2.       Copy the php_mssql.dll into PHP 5.3.x/ext.

3.       Copy ntwdblib.dll and MSVCR71.dll into sysWOW64 folder.

4.       Restart WAMP, Restart system also good advice.

Note:

1. Below CMD steps to check the required MSSQL DLL loaded or not. if the below command does not return anything, then PHP, MSSQL  installation  is success. if it return some alert with missing DLL message, then download that DLL and push into system32/ sysWOW64 folder.

execute this command in command prompt, make sure you should be inside the wamp/bin/php/php5.x.x/ext ) 

php -d extension_dir=ext -d extension=php_mssql.dll -d extension=C:\wamp\bin\apache\Apache2.2.17\bin –m