Skip to content

Instantly share code, notes, and snippets.

@risan
Created December 4, 2020 17:20
Show Gist options
  • Save risan/84c9d9296bc5855fb8c5cd983f691037 to your computer and use it in GitHub Desktop.
Save risan/84c9d9296bc5855fb8c5cd983f691037 to your computer and use it in GitHub Desktop.
Windows 10, Laragon, PHP 5.6, SQL Server

Install SQL Server Express

  1. Download SQL Server Express 2019: https://www.microsoft.com/en-us/sql-server/sql-server-downloads
  2. Choose CUSTOM install
  3. Choose media download target location, leave it default.
  4. On SQL Server Installation Center choose "New SQL Server stand-alone installation..." menu.
  5. On Feature Selection at least select the main "Database Engine Services" option (SQL Server Replication, Machine Learning stuff, Full-Text search are optional). Also make sure all "Client Tools..." options and "SQL Client Connectivity SDK" are selected.
  6. On Instance Configuration we set the SQL Server instance name, we can leave all options default (SQLEXPRESS).
  7. On Server Configuration, we can set the "Startup Type" for "SQL Server Database Engine" to manual. So in order to use the SQL Server, we have to start it manualy through the Sql Server Configuration Manager application.
  8. On Database Engine Configuration set the "Authentication Mode" to Mixed Mode. Specify the password for the sa user.

Install the old PHP 5.6

  1. Download laragon: https://laragon.org/download/
  2. Download the 32-bit version of PHP 5.6 even if you use a 64-bit OS :https://windows.php.net/downloads/releases/archives/php-5.6.40-Win32-VC11-x86.zip (We use the thread-safe version)
  3. Extract the downloaded zip and move the php-5.6.40-Win32-VC11-x86 folder to C:\laragon\bin\php.
  4. Download and install the 32-bit version of Visual C++ Redistributable for Visual Studio 2012 (VC11): https://www.microsoft.com/en-us/download/details.aspx?id=30679 (Choose vcredist_x86).
  5. To activate the 5.6 version, right-click on the Laragon app: PHP >> Version >> php-5.6.40-Win32-VC11-x86

Connecting PHP 5.6 with SQL Server

  1. Download the 64-bit version of ODBC Driver 11 for SQL Server: https://www.microsoft.com/en-us/download/details.aspx?id=36434
  2. Download Microsoft driver for PHP for SQL Server version 3.2: https://www.microsoft.com/en-us/download/details.aspx?id=20098 (Choose SQLSRV32.EXE). Once you run the executable, you'll find the php_pdo_sqlsrv_56_ts.dll and php_sqlsrv_56_ts.dll files on the extracted folder.
  3. Copy both php_pdo_sqlsrv_56_ts.dll and php_sqlsrv_56_ts.dll to C:\laragon\bin\php\php-5.6.40-Win32-VC11-x86\ext.
  4. To activate the extensions, right-click on Laragon: PHP >> Extensions >> Click those two new files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment