Having PHP5.6 works with SQL Server Driver on Windows

Few moment a go. I been looking how to  do this.  Recently, i  face  this again. 
Last time no  use  docker.  Now, in docker  era. I thoughts it  is  easy  to setup PHP5.6 with working SQL Server Driver. I  spend  1-2 days. This time is including to  have  IIS  together.

At  last i  conclude  that  it  is  very  easy  to have PHP5.6+SQL  Server Driver because the requirement is  to  install  SQL Server Client  as stated  in  the  documentation. 


The SQLSRV extension requires that the Microsoft SQL Server 2012 Native Client be installed on the same computer that is running PHP ~ php.net


Solution:

Use Chocolatey (choco)  all  the way


Installation:

You can install  Chocolatey in your Windows first.
https://chocolatey.org/install

First, install  the php  and sql  server client


You can change installation location (InstallDir). For example, from 'C:\php' to 'C:\php5.6.40'.

Chocolatey help install  the  php all dependencies together.

You will having php5.6.40 x64.


Then, load driver


That's all.



Tips:

You  might  want to run your php project on the spot. So,  can use built-in server  command

php -S localhost:3033 -c custom.ini

Refer here  for more  detail about the built-in server.

Giveaway:

Copy Paste:





Comments

Popular Posts