Questions tagged [sqlsrv]

The SQLSRV is a PHP extension which allows you to access Microsoft SQL Server and SQL Azure databases when running PHP on Windows or Linux.

References

999 questions
27
votes
7 answers

Docker: unixodbc.h no such file or directory. "pecl install sqlsrv" error with unixodbc-dev already installed

This had been working up until a few days ago. We are building a docker container with the following code, but this is the error that happens when trying to "pecl install sqlsrv". Trying to connect to mssql server from PHP in this container. Anyone…
dlove
  • 393
  • 3
  • 6
23
votes
3 answers

Error 1 ERROR: `make' failed when installing sqlsrv

I'm trying to install sqlsrv by using the commands from this page. However, when running pecl install sqlsrv-4.2.0preview I get the error: Error 1 ERROR: 'make' failed. I tried : apt-get update apt-get install build-essential apt-get install…
Edeholland
  • 377
  • 1
  • 3
  • 7
16
votes
4 answers

SQLSRV PHP for SQL Server for is not a valid Win32 application

Here is my setup Windows Server 2008 R2 64 bit Apache 2.4.4 64 bit PHP 5.4.15 32 bit (64 bit is still experimental), thread safe, VC9 compiler Microsoft SQL Server 2012 Native Client 64-bit Microsoft Visual C++ 2010 x86 and x64 I need to load…
iltdev
  • 1,789
  • 9
  • 27
  • 51
15
votes
4 answers

How to execute a stored procedure in php using sqlsrv and "?" style parameters

I've looked over several other questions that seem (from the titles) the same as this. However, my case is a bit different. The following works (i.e. I get "success" and my database performs what I expect when running the procedure with the given…
LittleTreeX
  • 1,259
  • 2
  • 12
  • 28
14
votes
4 answers

PHP sqlsrv query to database

I am migrated from MySQL to MS SQL Server, and trying to fetch all data from the routines table. I am connected but unsure how to fetch data with sqlsrv. This is how far I have came: $conn_array = array ( "UID" => "sa", "PWD" => "root", …
user3185936
  • 1,567
  • 6
  • 23
  • 44
12
votes
2 answers

sqlsrv_num_rows Not Returning Any Value

I am trying to get the number of rows returned in a query. The while loop looping through the results works, but for some reason the sqlsrv_num_rows does not return any value: $result = "SELECT * from dtable WHERE id2 = 'apple'"; $query =…
user1067577
  • 247
  • 1
  • 7
  • 15
10
votes
1 answer

Can't connect a azure sql server from laravel on linux

I have a laravel application that connect a sql server db on Azure. On my local Wamp server the application works. I have installed on my linux server using a docker image, and don't connect the Azure DB. Every time returns this error…
cesare
  • 2,098
  • 19
  • 29
9
votes
2 answers

How to point to manual install Microsoft ODBC Driver 13

I'm attempting to setup the Microsoft ODBC Driver on platform.sh so that the PDO_SQLSRV and SQLSRV PHP extensions are available to me. apt and other sudo commands are limited. However, during the build I can set environment variables such as…
tylersDisplayName
  • 1,603
  • 4
  • 24
  • 42
9
votes
3 answers

php 7 unable to initialize sqlsrv

I searched all day to find out a solution for sqlsrv dll on php 7 VC14 x64 Thread Safe and i did not found a solution. Does anyone solved this issue : [04-Oct-2015 19:48:05 UTC] PHP Warning: PHP Startup: pdo_sqlsrv: Unable to initialize…
Pierre-Luc Bolduc
  • 485
  • 1
  • 5
  • 18
8
votes
5 answers

Connecting php 7.2 to MS SQL using sqlsrv

I'm trying to get a connection to MS SQL up and running via PHP on my machine. I'm running IIS, have PHP 7.2 installed and MS SQL Express 2017. I have my basic web page running but when I click to open the PHP page, the connection does not…
Daves
  • 141
  • 1
  • 3
  • 6
8
votes
5 answers

How to fix PDO sqlsrv connection timeout in Laravel?

developer! I'm using Laravel framework and I need to connect to MS SQL 2014 Express database. I've made all the proper configurations in .env (and I even tried tried to put connection parameters straight away to the database.php config) but on the…
Andy Marrel
  • 103
  • 1
  • 6
8
votes
4 answers

Install SQLSRV driver on Linux, or other UTF-8 capable driver?

SQLSRV is the only driver for PHP that is capable of storing UTF-8 strings into two-byte columns (NVARCHAR instead of VARCHAR) which is currently maintained and supported by Microsoft for PHP 5.2.X and 5.3.X. And I also got the link for downloading…
hsuk
  • 6,770
  • 13
  • 50
  • 80
7
votes
3 answers

useradd invalid user in Dockerfile

I'm trying to use a docker image with Laravel + Microsoft SQL drivers. My dockerfile: FROM php:7.2-apache ENV ACCEPT_EULA=Y # Microsoft SQL Server Prerequisites RUN apt-get update \ && curl https://packages.microsoft.com/keys/microsoft.asc |…
Felipe Novaes
  • 73
  • 1
  • 5
6
votes
3 answers

Cannot connect to SQL Server with PHP script

I run SQL Server 2016. I try to connect to it via a PHP script (PHP version 8). I did install the drivers and added the path in the php.ini (same version as my PHP…
Andreas
  • 61
  • 1
  • 3
6
votes
1 answer

Get Column name in csv file

Working on creating a CSV file and wondering how I can get the column name in the first row. Right now I think it's trying to echo the Column name but getting 0'nulls. I am also wondering if it's possible to put each of the values in each cell, I…
user3580316
1
2 3
66 67