f3rland / homestead-mssql
A virtual machine for web artisans that include drivers for SQL Server.
Requires
- php: ^5.6 || ^7.0
- symfony/console: ~2.3|~3.0
- symfony/process: ~2.3|~3.0
- symfony/yaml: ~2.3|~3.0
Requires (Dev)
- phpunit/phpunit: ^5.7 || ^6.0
- v5.2.4.1
- v5.2.4
- 5.2.3
- 5.2.2
- v5.2.1
- v5.2.0
- v5.1.0
- v5.0.1
- v5.0.0
- dev-master / 4.0.x-dev
- v4.0.5
- v4.0.4
- v4.0.3
- v4.0.2
- v4.0.1
- v4.0.0
- v3.1.0
- v3.0.2
- v3.0.1
- v3.0.0
- v2.2.2
- v2.2.1
- v2.2.0
- v2.1.8
- v2.1.7
- v2.1.6
- v2.1.5
- v2.1.4
- v2.1.3
- v2.1.2
- v2.1.1
- v2.1.0
- 2.0.x-dev
- v2.0.17
- v2.0.16
- v2.0.15
- v2.0.14
- v2.0.13
- v2.0.12
- v2.0.11
- v2.0.10
- v2.0.9
- v2.0.8
- v2.0.7
- v2.0.6
- v2.0.5
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
This package is not auto-updated.
Last update: 2024-03-26 16:35:34 UTC
README
Introduction
Laravel Homestead MSSQL is an unofficial, pre-packaged Vagrant box that provides you a wonderful development environment without requiring you to install PHP, a web server, and any other server software on your local machine. No more worrying about messing up your operating system! Vagrant boxes are completely disposable. If something goes wrong, you can destroy and re-create the box in minutes!
Homestead runs on any Windows, Mac, or Linux system, and includes the Nginx web server, PHP 7.1, MySQL, Postgres, Redis, Memcached, Node, and all of the other goodies you need to develop amazing Laravel applications.
Official documentation is located here.
Start your MS SQL compatible laravel/homestead box
On Windows
composer require f3rland/homestead-mssql:dev-master --dev vendor\\bin\\homestead make vagrant up
You can validate your box with this code in /public/index.php
<?php #If you have a SQL Server Instance, use that scheme #$serverName = "Server,Port"; $serverName = "ServerName"; $connectionOptions = array( "Database" => "database name", "Uid" => "username", "PWD" => "long and secure password" ); //Establishes the connection $conn = sqlsrv_connect($serverName, $connectionOptions); if ($conn == FALSE) die(FormatErrors(sqlsrv_errors())); //Select Query $tsql= "SELECT @@Version as SQL_VERSION"; //Executes the query $getResults= sqlsrv_query($conn, $tsql); //Error handling if ($getResults == FALSE) die(FormatErrors(sqlsrv_errors())); ?> <h1> Results : </h1> <?php while ($row = sqlsrv_fetch_array($getResults, SQLSRV_FETCH_ASSOC)) { echo ($row['SQL_VERSION']); echo ("<br/>"); } sqlsrv_free_stmt($getResults); function FormatErrors( $errors ) { /* Display errors. */ echo "Error information: <br/>"; foreach ( $errors as $error ) { echo "SQLSTATE: ".$error['SQLSTATE']."<br/>"; echo "Code: ".$error['code']."<br/>"; echo "Message: ".$error['message']."<br/>"; } } ?>
based on Microsoft guide to install Microsoft PHP Drivers for SQL Server on linux