f3rland/homestead-mssql 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

f3rland/homestead-mssql

Composer 安装命令:

composer require f3rland/homestead-mssql

包简介

A virtual machine for web artisans that include drivers for SQL Server.

README 文档

README

Build Status Total Downloads Latest Stable Version License

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

统计信息

  • 总下载量: 315
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1398
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-05-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固