Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to SQLSRV Driver on Mac OS X #198

Closed
nohnaimer opened this issue Dec 10, 2016 · 37 comments
Closed

How to SQLSRV Driver on Mac OS X #198

nohnaimer opened this issue Dec 10, 2016 · 37 comments

Comments

@nohnaimer
Copy link

Hello,
Are there manual how to run sqlsrv driver on Mac OS X with brew installed php 7?
Any help?
Thank you!

@meet-bhagdev
Copy link
Contributor

@nohnaimer Check out sqlshim: https://github.com/radsectors/sqlshim.

@ulvii
Copy link
Contributor

ulvii commented Apr 17, 2017

Hi @nohnaimer,
The installation instructions can be found in the Readme file too: https://github.com/Microsoft/msphpsql/tree/dev#install-unix

@ulvii ulvii closed this as completed Apr 17, 2017
@nixtoshi
Copy link

nixtoshi commented Jun 14, 2017

When I try to install sqlsrv and sqlsrv pdo in Mac (MAMP) using the link @ulvii I receive the errors:
Cannot install pecl/pdo_sqlsrv on darwin operating system, can only install on linux

Best bet is probably using sqlshim for local testing in Mac, and then testing on the online servers

@ulvii
Copy link
Contributor

ulvii commented Jun 14, 2017

Hi @dalovar ,

Drivers are Mac-compatible starting from 4.1.7preview release. For the latest version you would run:

sudo pecl install pdo_sqlsrv-4.2.0preview

@nohnaimer
Copy link
Author

nohnaimer commented Jun 14, 2017

I installed here like this - https://github.com/Microsoft/msphpsql/tree/dev#install-unix

$ brew tap microsoft/mssql-preview https://github.com/Microsoft/homebrew-mssql-preview
$ brew update
$ brew install unixodbc
$ brew install msodbcsql
$ brew install mssql-tools
$ brew install llvm --with-clang --with-clang-extra-tools
$ brew install autoconf

$ sudo pear config-set php_ini php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||" system
$ sudo pecl install sqlsrv-4.1.7preview
$ sudo pecl install pdo_sqlsrv-4.1.7preview

Now I'm like this:
2017-06-14 14 31 07

But better put the latest version of 4.2.0preview
$ sudo pecl install sqlsrv-4.2.0preview
$ sudo pecl install pdo_sqlsrv-4.2.0preview

Question: How to upgrade 4.1.7 to 4.2.0?

@ulvii
Copy link
Contributor

ulvii commented Jun 14, 2017

Hi @nohnaimer ,

sudo pecl install pdo_sqlsrv-4.2.0preview will overwrite the older version.

@nixtoshi
Copy link

nixtoshi commented Jun 15, 2017

Installing sqlsrv-4.2.0preview and pdo_sqlsrv-4.2.0preview using pecl give me these errors:

sudo /Applications/MAMP/bin/php/php7.0.15/bin/pecl install sqlsrv-4.2.0preview
Error:

In file included from /private/tmp/pear/temp/sqlsrv/conn.cpp:20:
In file included from /private/tmp/pear/temp/sqlsrv/php_sqlsrv.h:25:
In file included from /private/tmp/pear/temp/sqlsrv/shared/core_sqlsrv.h:34:
In file included from /Applications/MAMP/bin/php/php7.0.15/include/php/main/php.h:35:
In file included from /Applications/MAMP/bin/php/php7.0.15/include/php/Zend/zend.h:35:
/Applications/MAMP/bin/php/php7.0.15/include/php/Zend/zend_string.h:326:2: warning: 'register' storage class specifier is deprecated and incompatible with C++1z [-Wdeprecated-register]
        register zend_ulong hash = Z_UL(5381);
        ^~~~~~~~~
In file included from /private/tmp/pear/temp/sqlsrv/conn.cpp:20:
In file included from /private/tmp/pear/temp/sqlsrv/php_sqlsrv.h:25:
In file included from /private/tmp/pear/temp/sqlsrv/shared/core_sqlsrv.h:34:
In file included from /Applications/MAMP/bin/php/php7.0.15/include/php/main/php.h:35:
In file included from /Applications/MAMP/bin/php/php7.0.15/include/php/Zend/zend.h:36:
/Applications/MAMP/bin/php/php7.0.15/include/php/Zend/zend_hash.h:251:2: warning: 'register' storage class specifier is deprecated and incompatible with C++1z [-Wdeprecated-register]
        register const char *tmp = key;
        ^~~~~~~~~
In file included from /private/tmp/pear/temp/sqlsrv/conn.cpp:20:
In file included from /private/tmp/pear/temp/sqlsrv/php_sqlsrv.h:25:
In file included from /private/tmp/pear/temp/sqlsrv/shared/core_sqlsrv.h:34:
In file included from /Applications/MAMP/bin/php/php7.0.15/include/php/main/php.h:35:
In file included from /Applications/MAMP/bin/php/php7.0.15/include/php/Zend/zend.h:341:
/Applications/MAMP/bin/php/php7.0.15/include/php/Zend/zend_operators.h:188:2: warning: 'register' storage class specifier is deprecated and incompatible with C++1z [-Wdeprecated-register]
        register const unsigned char *e;
        ^~~~~~~~~
In file included from /private/tmp/pear/temp/sqlsrv/conn.cpp:20:
In file included from /private/tmp/pear/temp/sqlsrv/php_sqlsrv.h:25:
In file included from /private/tmp/pear/temp/sqlsrv/shared/core_sqlsrv.h:41:
In file included from /private/tmp/pear/temp/sqlsrv/shared/FormattedPrint.h:24:
In file included from /private/tmp/pear/temp/sqlsrv/shared/xplat_winnls.h:24:
In file included from /private/tmp/pear/temp/sqlsrv/shared/typedefs_for_linux.h:23:
/private/tmp/pear/temp/sqlsrv/shared/xplat.h:30:10: fatal error: 'sql.h' file not found
#include <sql.h>
         ^
3 warnings and 1 error generated.
make: *** [conn.lo] Error 1
ERROR: `make' failed

sudo /Applications/MAMP/bin/php/php7.0.15/bin/pecl install pdo_sqlsrv-4.2.0preview
Error:

/Applications/MAMP/bin/php/php7.0.15/include/php/Zend/zend_string.h:326:2: warning: 'register' storage class specifier is deprecated and incompatible with C++1z [-Wdeprecated-register]
        register zend_ulong hash = Z_UL(5381);
        ^~~~~~~~~
In file included from /private/tmp/pear/temp/pdo_sqlsrv/pdo_dbh.cpp:20:
In file included from /private/tmp/pear/temp/pdo_sqlsrv/php_pdo_sqlsrv.h:23:
In file included from /private/tmp/pear/temp/pdo_sqlsrv/shared/core_sqlsrv.h:34:
In file included from /Applications/MAMP/bin/php/php7.0.15/include/php/main/php.h:35:
In file included from /Applications/MAMP/bin/php/php7.0.15/include/php/Zend/zend.h:36:
/Applications/MAMP/bin/php/php7.0.15/include/php/Zend/zend_hash.h:251:2: warning: 'register' storage class specifier is deprecated and incompatible with C++1z [-Wdeprecated-register]
        register const char *tmp = key;
        ^~~~~~~~~
In file included from /private/tmp/pear/temp/pdo_sqlsrv/pdo_dbh.cpp:20:
In file included from /private/tmp/pear/temp/pdo_sqlsrv/php_pdo_sqlsrv.h:23:
In file included from /private/tmp/pear/temp/pdo_sqlsrv/shared/core_sqlsrv.h:34:
In file included from /Applications/MAMP/bin/php/php7.0.15/include/php/main/php.h:35:
In file included from /Applications/MAMP/bin/php/php7.0.15/include/php/Zend/zend.h:341:
/Applications/MAMP/bin/php/php7.0.15/include/php/Zend/zend_operators.h:188:2: warning: 'register' storage class specifier is deprecated and incompatible with C++1z [-Wdeprecated-register]
        register const unsigned char *e;
        ^~~~~~~~~
In file included from /private/tmp/pear/temp/pdo_sqlsrv/pdo_dbh.cpp:20:
In file included from /private/tmp/pear/temp/pdo_sqlsrv/php_pdo_sqlsrv.h:23:
In file included from /private/tmp/pear/temp/pdo_sqlsrv/shared/core_sqlsrv.h:41:
In file included from /private/tmp/pear/temp/pdo_sqlsrv/shared/FormattedPrint.h:24:
In file included from /private/tmp/pear/temp/pdo_sqlsrv/shared/xplat_winnls.h:24:
In file included from /private/tmp/pear/temp/pdo_sqlsrv/shared/typedefs_for_linux.h:23:
/private/tmp/pear/temp/pdo_sqlsrv/shared/xplat.h:30:10: fatal error: 'sql.h' file not found
#include <sql.h>
         ^
3 warnings and 1 error generated.
make: *** [pdo_dbh.lo] Error 1
ERROR: `make' failed

Tried to install sqlsrv 4.1.7 too, but I'm getting the same errors. I did all the previous steps successfully, except installing PHP because it was already installed. Any idea on what's going on? Using MAMP Version 4.1.1 (492) with PHP 7.0.15 on MacOS 10.12.5 and trying to install sqlsrv on this PHP version to run tests locally as well as in my azure server.

@ulvii
Copy link
Contributor

ulvii commented Jun 15, 2017

@dalovar ,

Please post the output of the following commands:

1. odbcinst -j
2. odbcinst -q -d -n "ODBC Driver 13 for SQL Server"
3. find /usr 2>/dev/null -name "libodbc*"
4. php -i | grep "Configure Command"

@nixtoshi
Copy link

nixtoshi commented Jun 15, 2017

  1. odbcinst -j
unixODBC 2.3.4
DRIVERS............: /usr/local/Cellar/unixodbc/2.3.4/etc/odbcinst.ini
SYSTEM DATA SOURCES: /usr/local/Cellar/unixodbc/2.3.4/etc/odbc.ini
FILE DATA SOURCES..: /usr/local/Cellar/unixodbc/2.3.4/etc/ODBCDataSources
USER DATA SOURCES..: /Users/dalovar/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8
  1. odbcinst -q -d -n "ODBC Driver 13 for SQL Server"
[ODBC Driver 13 for SQL Server]
Description=Microsoft ODBC Driver 13 for SQL Server
Driver=/usr/local/lib/libmsodbcsql.13.dylib
UsageCount=1
  1. find /usr 2>/dev/null -name "libodbc*"
/usr/local/Cellar/unixodbc/2.3.2_1/lib/libodbc.2.dylib
/usr/local/Cellar/unixodbc/2.3.2_1/lib/libodbc.dylib
/usr/local/Cellar/unixodbc/2.3.2_1/lib/libodbccr.2.dylib
/usr/local/Cellar/unixodbc/2.3.2_1/lib/libodbccr.dylib
/usr/local/Cellar/unixodbc/2.3.2_1/lib/libodbcinst.2.dylib
/usr/local/Cellar/unixodbc/2.3.2_1/lib/libodbcinst.dylib
/usr/local/Cellar/unixodbc/2.3.4/lib/libodbc.2.dylib
/usr/local/Cellar/unixodbc/2.3.4/lib/libodbc.a
/usr/local/Cellar/unixodbc/2.3.4/lib/libodbc.dylib
/usr/local/Cellar/unixodbc/2.3.4/lib/libodbccr.2.dylib
/usr/local/Cellar/unixodbc/2.3.4/lib/libodbccr.a
/usr/local/Cellar/unixodbc/2.3.4/lib/libodbccr.dylib
/usr/local/Cellar/unixodbc/2.3.4/lib/libodbcinst.2.dylib
/usr/local/Cellar/unixodbc/2.3.4/lib/libodbcinst.a
/usr/local/Cellar/unixodbc/2.3.4/lib/libodbcinst.dylib
/usr/local/lib/libodbc.2.dylib
/usr/local/lib/libodbc.a
/usr/local/lib/libodbc.dylib
/usr/local/lib/libodbccr.2.dylib
/usr/local/lib/libodbccr.a
/usr/local/lib/libodbccr.dylib
/usr/local/lib/libodbcinst.2.dylib
/usr/local/lib/libodbcinst.a
/usr/local/lib/libodbcinst.dylib
  1. php -i | grep "Configure Command"
    The output is one big line:
Configure Command =>  '/Library/Caches/com.apple.xbs/Binaries/apache_mod_php/apache_mod_php-117.2~3/TempContent/Objects/php/configure'  '--prefix=/usr' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--disable-dependency-tracking' '--sysconfdir=/private/etc' '--with-libdir=lib' '--enable-cli' '--with-iconv=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.Internal.sdk/usr' '--with-config-file-path=/etc' '--with-libxml-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.Internal.sdk/usr' '--with-openssl=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.Internal.sdk/usr/local/libressl' '--with-kerberos=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.Internal.sdk/usr' '--with-zlib=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.Internal.sdk/usr' '--enable-bcmath' '--with-bz2=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.Internal.sdk/usr' '--enable-calendar' '--disable-cgi' '--with-curl=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.Internal.sdk/usr' '--enable-dba' '--with-ndbm=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.Internal.sdk/usr' '--enable-exif' '--enable-fpm' '--enable-ftp' '--with-gd' '--with-png-dir=/Library/Caches/com.apple.xbs/Binaries/apache_mod_php/apache_mod_php-117.2~3/Root/usr/local' '--with-jpeg-dir=/Library/Caches/com.apple.xbs/Binaries/apache_mod_php/apache_mod_php-117.2~3/Root/usr/local' '--enable-gd-native-ttf' '--with-icu-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.Internal.sdk/usr' '--with-ldap=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.Internal.sdk/usr' '--with-ldap-sasl=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.Internal.sdk/usr' '--with-libedit=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.Internal.sdk/usr' '--enable-mbstring' '--enable-mbregex' '--with-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-pdo-pgsql=/usr/local/bin/pg_config' '--with-pgsql=/usr/local/bin/pg_config' '--without-pear' '--with-pear=no' '--with-pdo-mysql=mysqlnd' '--with-mysql-sock=/var/mysql/mysql.sock' '--with-readline=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.Internal.sdk/usr' '--enable-shmop' '--with-snmp=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.Internal.sdk/usr' '--enable-soap' '--enable-sockets' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--with-tidy=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.Internal.sdk/usr' '--enable-wddx' '--with-xmlrpc' '--with-iconv-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.Internal.sdk/usr' '--with-xsl=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.Internal.sdk/usr' '--enable-zend-multibyte' '--with-apxs2=/usr/sbin/apxs' '--enable-zip' '--with-pcre-regex=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.Internal.sdk/usr' 'CC=/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.12.xctoolchain/usr/bin/cc' 'CFLAGS=-arch '-pipe' '-Os' '-g' '-isysroot' '-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.Internal.sdk/usr/include' '-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.Internal.sdk/usr/include/apache2'' 'LDFLAGS=-arch '-pipe' '-Os' '-g' '-L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.Internal.sdk/usr/lib'' 'YACC=/usr/local/bin/bison-1.28' 'CXX=/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.12.xctoolchain/usr/bin/c++' 'CXXFLAGS=-arch '-g' '-Os' '-pipe'

@nixtoshi
Copy link

nixtoshi commented Jun 15, 2017

php -v

PHP 5.6.30 (cli) (built: Feb  7 2017 16:18:37)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

The PHP version most likely the problem. I found another issue with a similar error here: #373
Everything was using the PHP that was linked to the system's PHP version (5.6). I am now redoing everything using php 7.0. I'm thinking that this will install sqlsrv on the system's php (7.0).

Update: Yup. It works now. The problem was the PHP that the system was using (5.6 instead of 7/7.1). Sorry for the mess. I'm uninstalling MAMP and using Apache and PHP directly with the terminal. Thank you for the help!

@ulvii
Copy link
Contributor

ulvii commented Jun 15, 2017

Hi @dalovar ,

Glad you could get the driver working. Feel free to open a new issue if you have any other questions.

@techsavvyashish
Copy link

I have also updated the php version, but still I am unable to install sqlsrv driver.
php -v
PHP 7.0.18 (cli) (built: May 6 2017 09:49:26) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies with Zend OPcache v7.0.18, Copyright (c) 1999-2017, by Zend Technologies with Xdebug v2.5.3, Copyright (c) 2002-2017, by Derick Rethans

@nohnaimer
Copy link
Author

@techsavvyashish everything is fine on php 7.1.8 and I update for 4.3.0 sqlsrv release. You are clearly doing something wrong!

Proof:
2017-08-10 8 57 31
2017-08-10 8 57 53
2017-08-10 9 01 59

@VictorChavezMX
Copy link

Hope this help:
i add the CXXFLAGS & LDFLAGS to point to unixodbc headers files and unixodbc lib path, this helps to compile the modules with pecl

sudo CXXFLAGS="-I/usr/local/opt/unixodbc/include" LDFLAGS="-L/usr/local/lib" pecl install pdo_sqlsrv
sudo CXXFLAGS="-I/usr/local/opt/unixodbc/include" LDFLAGS="-L/usr/local/lib" pecl install sqlsrv

added the .so libraries as result inside /etc/php.ini

image
image

@borzale
Copy link

borzale commented Sep 11, 2017

@vivlachaga Thank you SO much. This was the missing step I needed to get it working on OSX Sierra 10.12.4.

It worked perfectly with MAMP 4 running php 7.0.20, I just had to add that version of php to my $PATH and it automatically picked that up while running the install commands.

If this step could be added to the UNIX instruction page (https://github.com/Microsoft/msphpsql/tree/dev#install-unix) that would be awesome. It's not that common for web developers to pick up header files for compiling stuff! (from my experience anyway :) )

Edit: I also had to specify the MAMP pecl for installing. This is what got it working for me in the end.
sudo CXXFLAGS="-I/usr/local/opt/unixodbc/include" LDFLAGS="-L/usr/local/lib" /Applications/MAMP/bin/php/php7.0.20/bin/pecl install sqlsrv

@tartesso26
Copy link

when installing sqlsrv on mac high sierra with sudo pecl install pdo_sqlsrv

it´s appear to go well but in the end i get

Build process completed successfully
Installing '/usr/lib/php/extensions/no-debug-non-zts-20160303/pdo_sqlsrv.so'
ERROR: failed to write /usr/lib/php/extensions/no-debug-non-zts-20160303/pdo_sqlsrv.so (copy(/usr/lib/php/extensions/no-debug-non-zts-20160303/pdo_sqlsrv.so): failed to open stream: Operation not permitted)

and the sqlsrv.so is not available and not appear in phpinfo()

somebody could help me?

@VictorChavezMX
Copy link

You need to reboot your mac and press ⌘+R when booting up. Then go into Utilities > Terminal and type the following commands:

csrutil disable
reboot
This is a result of System Integrity Protection.

https://developer.apple.com/library/content/documentation/Security/Conceptual/System_Integrity_Protection_Guide/ConfiguringSystemIntegrityProtection/ConfiguringSystemIntegrityProtection.html

@joao-s-neves
Copy link

Hi guys, I need some help installing PDO SQL Server drivers for Mac OS X.
Followed this (https://github.com/Microsoft/msphpsql/tree/dev#install-unix) tutorial and everything went well. Except for the fact that the PDO drivers don't show up in phpinfo(); despite the command "php -m | grep sqlsrv" showing me the drivers.

Also, phpinfo() is showing me the path to a php.ini that's completely empty, and when I do php --ini it points me out to a php.ini that has zero extensions on it.

Can someone help me out?

@VictorChavezMX
Copy link

VictorChavezMX commented Nov 20, 2017 via email

@kieuquangloc
Copy link

I just created a video to install sqlsrv for MAMP on mac:
https://youtu.be/PRH04PxZpUk

@ijpatricio
Copy link

awesome guys!! don't need a VM any more, justfor the sole purpose because of sqlserver!

https://www.microsoft.com/en-us/sql-server/developer-get-started/php/mac/

@heberfomin
Copy link

hi @nohnaimer:
I followed your steps:
$ brew tap microsoft/mssql-preview https://github.com/Microsoft/homebrew-mssql-preview
$ brew update
$ brew install unixodbc
$ brew install msodbcsql
$ brew install mssql-tools
$ brew install llvm --with-clang --with-clang-extra-tools
$ brew install autoconf

$ sudo pear config-set php_ini php --ini | grep "Loaded Configuration" | sed -e "s|.:\s||" system

Everything runs ok, but, when I tried to make:
$ sudo pecl install sqlsrv-4.2.0preview
I got the following errors:
...
In file included from /private/tmp/pear/install/sqlsrv/conn.cpp:20:
In file included from /private/tmp/pear/install/sqlsrv/php_sqlsrv.h:25:
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:34:10: fatal error: 'php.h' file not found
#include "php.h"
^~~~~~~
1 error generated.
make: *** [conn.lo] Error 1
ERROR: `make' failed

Do you know how can I fix it?

@yitam
Copy link
Contributor

yitam commented Apr 3, 2018

Hi @heberfomin
Just wondering why you wanted an old preview when we already have 5.2.0 stable version released?
For instructions on installing the drivers, please click our tutorial. If you still have problems, please create a new issue, and if you like, you can reference this old issue.

@nohnaimer
Copy link
Author

Hi @heberfomin
Try this:
$ sudo pecl install sqlsrv pdo_sqlsrv

@heberfomin
Copy link

@nohnaimer
Same error. It seems that I don't have any php.h. I tried to find it but there only one in
./Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/php/main/php.h
but I don't know if is the correct.
Thanks for you help anyway.

@nohnaimer
Copy link
Author

nohnaimer commented Apr 3, 2018

@heberfomin
What version of php?
Try first, maybe you forgot something ...

php installed and work

brew install llvm --with-clang --with-clang-extra-tools
brew install autoconf
brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release
brew update
HOMEBREW_NO_ENV_FILTERING=1 ACCEPT_EULA=y brew install --no-sandbox msodbcsql mssql-tools
sudo pecl install sqlsrv pdo_sqlsrv
sudo echo "extension= pdo_sqlsrv.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
sudo echo "extension= sqlsrv.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`

@heberfomin
Copy link

heberfomin commented Apr 3, 2018

I tried again as you suggest.
I got a lot of issues in pecl install sqlsrv pdo_sqlsrv:

WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading sqlsrv-5.2.0.tgz ...
Starting to download sqlsrv-5.2.0.tgz (171,728 bytes)
.....................................done: 171,728 bytes
downloading pdo_sqlsrv-5.2.0.tgz ...
Starting to download pdo_sqlsrv-5.2.0.tgz (164,456 bytes)
...done: 164,456 bytes
33 source files, building
running: phpize
Configuring for:
PHP Api Version: 20160303
Zend Module Api No: 20160303
Zend Extension Api No: 320160303
building in /private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0
running: /private/tmp/pear/install/sqlsrv/configure --with-php-config=/usr/bin/php-config
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-apple-darwin17.5.0
checking host system type... x86_64-apple-darwin17.5.0
checking target system type... x86_64-apple-darwin17.5.0
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib
checking for PHP extension directory... /usr/lib/php/extensions/no-debug-non-zts-20160303
checking for PHP installed headers prefix... /usr/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking if awk is broken... no
checking whether to enable sqlsrv functions... yes, shared
checking for SQLSRV headers... /private/tmp/pear/install/sqlsrv/shared/
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by cc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking how to run the C++ preprocessor... g++ -E
checking the maximum length of command line arguments... 196608
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking if cc supports -fno-rtti -fno-exceptions... yes
checking for cc option to produce PIC... -fno-common
checking if cc PIC flag -fno-common works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin17.5.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by g++... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking whether the g++ linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fno-common
checking if g++ PIC flag -fno-common works... yes
checking if g++ static flag -static works... no
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin17.5.0 dyld
(cached) (cached) checking how to hardcode library paths into programs... immediate
configure: creating ./config.status
config.status: creating config.h
running: make
/bin/sh /private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/libtool --mode=compile g++ -std=c++11 -I. -I/private/tmp/pear/install/sqlsrv -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/include -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/main -I/private/tmp/pear/install/sqlsrv -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/private/tmp/pear/install/sqlsrv/shared/ -DHAVE_CONFIG_H -std=c++11 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector -c /private/tmp/pear/install/sqlsrv/conn.cpp -o conn.lo
mkdir .libs
g++ -std=c++11 -I. -I/private/tmp/pear/install/sqlsrv -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/include -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/main -I/private/tmp/pear/install/sqlsrv -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/private/tmp/pear/install/sqlsrv/shared/ -DHAVE_CONFIG_H -std=c++11 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector -c /private/tmp/pear/install/sqlsrv/conn.cpp -fno-common -DPIC -o .libs/conn.o
In file included from /private/tmp/pear/install/sqlsrv/conn.cpp:20:
In file included from /private/tmp/pear/install/sqlsrv/php_sqlsrv.h:25:
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1752:29: warning: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Wvarargs]
va_start( print_params, warning );
^
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1749:120: note: parameter of type 'bool' is declared here
inline bool call_error_handler( Inout sqlsrv_context& ctx, In unsigned long sqlsrv_error_code TSRMLS_DC, In bool warning, ... )
^
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1761:29: warning: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Wvarargs]
va_start( print_params, warning );
^
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1758:120: note: parameter of type 'bool' is declared here
inline bool call_error_handler( Inout sqlsrv_context* ctx, In unsigned long sqlsrv_error_code TSRMLS_DC, In bool warning, ... )
^
In file included from /private/tmp/pear/install/sqlsrv/conn.cpp:20:
/private/tmp/pear/install/sqlsrv/php_sqlsrv.h:514:20: warning: expression result unused [-Wunused-value]
SQLSRV_UNUSED( return_value );
^~~~~~~~~~~~
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1643:32: note: expanded from macro 'SQLSRV_UNUSED'
#define SQLSRV_UNUSED( var ) var;
^~~
/private/tmp/pear/install/sqlsrv/conn.cpp:1218:22: warning: enumeration value 'CONN_ATTR_INVALID' not handled in switch [-Wswitch]
switch( SS_CONN_OPTS[ i ].value_type ) {
^
/private/tmp/pear/install/sqlsrv/conn.cpp:1218:22: note: add missing switch cases
switch( SS_CONN_OPTS[ i ].value_type ) {
^
In file included from /private/tmp/pear/install/sqlsrv/conn.cpp:20:
/private/tmp/pear/install/sqlsrv/php_sqlsrv.h:514:20: warning: expression result unused [-Wunused-value]
SQLSRV_UNUSED( return_value );
^~~~~~~~~~~~
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1643:32: note: expanded from macro 'SQLSRV_UNUSED'
#define SQLSRV_UNUSED( var ) var;
^~~
/private/tmp/pear/install/sqlsrv/conn.cpp:597:5: note: in instantiation of function template specialization 'process_params<ss_sqlsrv_conn>' requested here
PROCESS_PARAMS( conn, "r", FN, 0 );
^
/private/tmp/pear/install/sqlsrv/conn.cpp:168:12: note: expanded from macro 'PROCESS_PARAMS'
rsrc = process_params<ss_sqlsrv_conn>( INTERNAL_FUNCTION_PARAM_PASSTHRU, param_spec, calling_func, param_count, ##VA_ARGS );
^
5 warnings generated.
/bin/sh /private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/libtool --mode=compile g++ -std=c++11 -I. -I/private/tmp/pear/install/sqlsrv -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/include -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/main -I/private/tmp/pear/install/sqlsrv -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/private/tmp/pear/install/sqlsrv/shared/ -DHAVE_CONFIG_H -std=c++11 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector -c /private/tmp/pear/install/sqlsrv/util.cpp -o util.lo
g++ -std=c++11 -I. -I/private/tmp/pear/install/sqlsrv -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/include -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/main -I/private/tmp/pear/install/sqlsrv -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/private/tmp/pear/install/sqlsrv/shared/ -DHAVE_CONFIG_H -std=c++11 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector -c /private/tmp/pear/install/sqlsrv/util.cpp -fno-common -DPIC -o .libs/util.o
In file included from /private/tmp/pear/install/sqlsrv/util.cpp:22:
In file included from /private/tmp/pear/install/sqlsrv/php_sqlsrv.h:25:
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1752:29: warning: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Wvarargs]
va_start( print_params, warning );
^
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1749:120: note: parameter of type 'bool' is declared here
inline bool call_error_handler( Inout sqlsrv_context& ctx, In unsigned long sqlsrv_error_code TSRMLS_DC, In bool warning, ... )
^
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1761:29: warning: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Wvarargs]
va_start( print_params, warning );
^
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1758:120: note: parameter of type 'bool' is declared here
inline bool call_error_handler( Inout sqlsrv_context* ctx, In unsigned long sqlsrv_error_code TSRMLS_DC, In bool warning, ... )
^
In file included from /private/tmp/pear/install/sqlsrv/util.cpp:22:
/private/tmp/pear/install/sqlsrv/php_sqlsrv.h:514:20: warning: expression result unused [-Wunused-value]
SQLSRV_UNUSED( return_value );
^~~~~~~~~~~~
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1643:32: note: expanded from macro 'SQLSRV_UNUSED'
#define SQLSRV_UNUSED( var ) var;
^~~
/private/tmp/pear/install/sqlsrv/util.cpp:475:20: warning: expression result unused [-Wunused-value]
SQLSRV_UNUSED( execute_data );
^~~~~~~~~~~~
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1643:32: note: expanded from macro 'SQLSRV_UNUSED'
#define SQLSRV_UNUSED( var ) var;
^~~
/private/tmp/pear/install/sqlsrv/util.cpp:529:20: warning: expression result unused [-Wunused-value]
SQLSRV_UNUSED( execute_data );
^~~~~~~~~~~~
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1643:32: note: expanded from macro 'SQLSRV_UNUSED'
#define SQLSRV_UNUSED( var ) var;
^~~
/private/tmp/pear/install/sqlsrv/util.cpp:652:20: warning: expression result unused [-Wunused-value]
SQLSRV_UNUSED( execute_data );
^~~~~~~~~~~~
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1643:32: note: expanded from macro 'SQLSRV_UNUSED'
#define SQLSRV_UNUSED( var ) var;
^~~
6 warnings generated.
/bin/sh /private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/libtool --mode=compile g++ -std=c++11 -I. -I/private/tmp/pear/install/sqlsrv -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/include -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/main -I/private/tmp/pear/install/sqlsrv -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/private/tmp/pear/install/sqlsrv/shared/ -DHAVE_CONFIG_H -std=c++11 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector -c /private/tmp/pear/install/sqlsrv/init.cpp -o init.lo
g++ -std=c++11 -I. -I/private/tmp/pear/install/sqlsrv -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/include -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/main -I/private/tmp/pear/install/sqlsrv -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/private/tmp/pear/install/sqlsrv/shared/ -DHAVE_CONFIG_H -std=c++11 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector -c /private/tmp/pear/install/sqlsrv/init.cpp -fno-common -DPIC -o .libs/init.o
In file included from /private/tmp/pear/install/sqlsrv/init.cpp:19:
In file included from /private/tmp/pear/install/sqlsrv/php_sqlsrv.h:25:
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1752:29: warning: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Wvarargs]
va_start( print_params, warning );
^
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1749:120: note: parameter of type 'bool' is declared here
inline bool call_error_handler( Inout sqlsrv_context& ctx, In unsigned long sqlsrv_error_code TSRMLS_DC, In bool warning, ... )
^
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1761:29: warning: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Wvarargs]
va_start( print_params, warning );
^
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1758:120: note: parameter of type 'bool' is declared here
inline bool call_error_handler( Inout sqlsrv_context* ctx, In unsigned long sqlsrv_error_code TSRMLS_DC, In bool warning, ... )
^
In file included from /private/tmp/pear/install/sqlsrv/init.cpp:19:
/private/tmp/pear/install/sqlsrv/php_sqlsrv.h:514:20: warning: expression result unused [-Wunused-value]
SQLSRV_UNUSED( return_value );
^~~~~~~~~~~~
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1643:32: note: expanded from macro 'SQLSRV_UNUSED'
#define SQLSRV_UNUSED( var ) var;
^~~
/private/tmp/pear/install/sqlsrv/init.cpp:266:20: warning: expression result unused [-Wunused-value]
SQLSRV_UNUSED( type );
^~~~
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1643:32: note: expanded from macro 'SQLSRV_UNUSED'
#define SQLSRV_UNUSED( var ) var;
^~~
/private/tmp/pear/install/sqlsrv/init.cpp:591:20: warning: expression result unused [-Wunused-value]
SQLSRV_UNUSED( type );
^~~~
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1643:32: note: expanded from macro 'SQLSRV_UNUSED'
#define SQLSRV_UNUSED( var ) var;
^~~
/private/tmp/pear/install/sqlsrv/init.cpp:625:20: warning: expression result unused [-Wunused-value]
SQLSRV_UNUSED( module_number );
^~~~~~~~~~~~~
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1643:32: note: expanded from macro 'SQLSRV_UNUSED'
#define SQLSRV_UNUSED( var ) var;
^~~
/private/tmp/pear/install/sqlsrv/init.cpp:626:20: warning: expression result unused [-Wunused-value]
SQLSRV_UNUSED( type );
^~~~
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1643:32: note: expanded from macro 'SQLSRV_UNUSED'
#define SQLSRV_UNUSED( var ) var;
^~~
/private/tmp/pear/install/sqlsrv/init.cpp:666:20: warning: expression result unused [-Wunused-value]
SQLSRV_UNUSED( module_number );
^~~~~~~~~~~~~
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1643:32: note: expanded from macro 'SQLSRV_UNUSED'
#define SQLSRV_UNUSED( var ) var;
^~~
/private/tmp/pear/install/sqlsrv/init.cpp:667:20: warning: expression result unused [-Wunused-value]
SQLSRV_UNUSED( type );
^~~~
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1643:32: note: expanded from macro 'SQLSRV_UNUSED'
#define SQLSRV_UNUSED( var ) var;
^~~
9 warnings generated.
/bin/sh /private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/libtool --mode=compile g++ -std=c++11 -I. -I/private/tmp/pear/install/sqlsrv -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/include -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/main -I/private/tmp/pear/install/sqlsrv -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/private/tmp/pear/install/sqlsrv/shared/ -DHAVE_CONFIG_H -std=c++11 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector -c /private/tmp/pear/install/sqlsrv/stmt.cpp -o stmt.lo
g++ -std=c++11 -I. -I/private/tmp/pear/install/sqlsrv -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/include -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/main -I/private/tmp/pear/install/sqlsrv -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/private/tmp/pear/install/sqlsrv/shared/ -DHAVE_CONFIG_H -std=c++11 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector -c /private/tmp/pear/install/sqlsrv/stmt.cpp -fno-common -DPIC -o .libs/stmt.o
In file included from /private/tmp/pear/install/sqlsrv/stmt.cpp:21:
In file included from /private/tmp/pear/install/sqlsrv/php_sqlsrv.h:25:
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1752:29: warning: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Wvarargs]
va_start( print_params, warning );
^
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1749:120: note: parameter of type 'bool' is declared here
inline bool call_error_handler( Inout sqlsrv_context& ctx, In unsigned long sqlsrv_error_code TSRMLS_DC, In bool warning, ... )
^
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1761:29: warning: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Wvarargs]
va_start( print_params, warning );
^
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1758:120: note: parameter of type 'bool' is declared here
inline bool call_error_handler( Inout sqlsrv_context* ctx, In unsigned long sqlsrv_error_code TSRMLS_DC, In bool warning, ... )
^
In file included from /private/tmp/pear/install/sqlsrv/stmt.cpp:21:
/private/tmp/pear/install/sqlsrv/php_sqlsrv.h:514:20: warning: expression result unused [-Wunused-value]
SQLSRV_UNUSED( return_value );
^~~~~~~~~~~~
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1643:32: note: expanded from macro 'SQLSRV_UNUSED'
#define SQLSRV_UNUSED( var ) var;
^~~
In file included from /private/tmp/pear/install/sqlsrv/stmt.cpp:21:
/private/tmp/pear/install/sqlsrv/php_sqlsrv.h:514:20: warning: expression result unused [-Wunused-value]
SQLSRV_UNUSED( return_value );
^~~~~~~~~~~~
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1643:32: note: expanded from macro 'SQLSRV_UNUSED'
#define SQLSRV_UNUSED( var ) var;
^~~
/private/tmp/pear/install/sqlsrv/stmt.cpp:281:9: note: in instantiation of function template specialization 'process_params<ss_sqlsrv_stmt>' requested here
PROCESS_PARAMS( stmt, "r", FN, 0 );
^
/private/tmp/pear/install/sqlsrv/stmt.cpp:253:12: note: expanded from macro 'PROCESS_PARAMS'
rsrc = process_params<ss_sqlsrv_stmt>( INTERNAL_FUNCTION_PARAM_PASSTHRU, param_spec, calling_func, param_count, ## VA_ARGS );
^
4 warnings generated.
/bin/sh /private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/libtool --mode=compile g++ -std=c++11 -I. -I/private/tmp/pear/install/sqlsrv -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/include -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/main -I/private/tmp/pear/install/sqlsrv -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/private/tmp/pear/install/sqlsrv/shared/ -DHAVE_CONFIG_H -std=c++11 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector -c /private/tmp/pear/install/sqlsrv/shared/core_conn.cpp -o shared/core_conn.lo
mkdir shared/.libs
g++ -std=c++11 -I. -I/private/tmp/pear/install/sqlsrv -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/include -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/main -I/private/tmp/pear/install/sqlsrv -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/private/tmp/pear/install/sqlsrv/shared/ -DHAVE_CONFIG_H -std=c++11 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector -c /private/tmp/pear/install/sqlsrv/shared/core_conn.cpp -fno-common -DPIC -o shared/.libs/core_conn.o
In file included from /private/tmp/pear/install/sqlsrv/shared/core_conn.cpp:20:
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1752:29: warning: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Wvarargs]
va_start( print_params, warning );
^
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1749:120: note: parameter of type 'bool' is declared here
inline bool call_error_handler( Inout sqlsrv_context& ctx, In unsigned long sqlsrv_error_code TSRMLS_DC, In bool warning, ... )
^
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1761:29: warning: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Wvarargs]
va_start( print_params, warning );
^
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1758:120: note: parameter of type 'bool' is declared here
inline bool call_error_handler( Inout sqlsrv_context* ctx, In unsigned long sqlsrv_error_code TSRMLS_DC, In bool warning, ... )
^
2 warnings generated.
/bin/sh /private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/libtool --mode=compile g++ -std=c++11 -I. -I/private/tmp/pear/install/sqlsrv -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/include -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/main -I/private/tmp/pear/install/sqlsrv -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/private/tmp/pear/install/sqlsrv/shared/ -DHAVE_CONFIG_H -std=c++11 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector -c /private/tmp/pear/install/sqlsrv/shared/core_results.cpp -o shared/core_results.lo
g++ -std=c++11 -I. -I/private/tmp/pear/install/sqlsrv -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/include -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/main -I/private/tmp/pear/install/sqlsrv -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/private/tmp/pear/install/sqlsrv/shared/ -DHAVE_CONFIG_H -std=c++11 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector -c /private/tmp/pear/install/sqlsrv/shared/core_results.cpp -fno-common -DPIC -o shared/.libs/core_results.o
In file included from /private/tmp/pear/install/sqlsrv/shared/core_results.cpp:20:
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1752:29: warning: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Wvarargs]
va_start( print_params, warning );
^
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1749:120: note: parameter of type 'bool' is declared here
inline bool call_error_handler( Inout sqlsrv_context& ctx, In unsigned long sqlsrv_error_code TSRMLS_DC, In bool warning, ... )
^
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1761:29: warning: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Wvarargs]
va_start( print_params, warning );
^
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1758:120: note: parameter of type 'bool' is declared here
inline bool call_error_handler( Inout sqlsrv_context* ctx, In unsigned long sqlsrv_error_code TSRMLS_DC, In bool warning, ... )
^
2 warnings generated.
/bin/sh /private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/libtool --mode=compile g++ -std=c++11 -I. -I/private/tmp/pear/install/sqlsrv -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/include -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/main -I/private/tmp/pear/install/sqlsrv -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/private/tmp/pear/install/sqlsrv/shared/ -DHAVE_CONFIG_H -std=c++11 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector -c /private/tmp/pear/install/sqlsrv/shared/core_stream.cpp -o shared/core_stream.lo
g++ -std=c++11 -I. -I/private/tmp/pear/install/sqlsrv -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/include -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/main -I/private/tmp/pear/install/sqlsrv -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/private/tmp/pear/install/sqlsrv/shared/ -DHAVE_CONFIG_H -std=c++11 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector -c /private/tmp/pear/install/sqlsrv/shared/core_stream.cpp -fno-common -DPIC -o shared/.libs/core_stream.o
In file included from /private/tmp/pear/install/sqlsrv/shared/core_stream.cpp:20:
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1752:29: warning: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Wvarargs]
va_start( print_params, warning );
^
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1749:120: note: parameter of type 'bool' is declared here
inline bool call_error_handler( Inout sqlsrv_context& ctx, In unsigned long sqlsrv_error_code TSRMLS_DC, In bool warning, ... )
^
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1761:29: warning: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Wvarargs]
va_start( print_params, warning );
^
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1758:120: note: parameter of type 'bool' is declared here
inline bool call_error_handler( Inout sqlsrv_context* ctx, In unsigned long sqlsrv_error_code TSRMLS_DC, In bool warning, ... )
^
2 warnings generated.
/bin/sh /private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/libtool --mode=compile g++ -std=c++11 -I. -I/private/tmp/pear/install/sqlsrv -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/include -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/main -I/private/tmp/pear/install/sqlsrv -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/private/tmp/pear/install/sqlsrv/shared/ -DHAVE_CONFIG_H -std=c++11 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector -c /private/tmp/pear/install/sqlsrv/shared/core_init.cpp -o shared/core_init.lo
g++ -std=c++11 -I. -I/private/tmp/pear/install/sqlsrv -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/include -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/main -I/private/tmp/pear/install/sqlsrv -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/private/tmp/pear/install/sqlsrv/shared/ -DHAVE_CONFIG_H -std=c++11 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector -c /private/tmp/pear/install/sqlsrv/shared/core_init.cpp -fno-common -DPIC -o shared/.libs/core_init.o
In file included from /private/tmp/pear/install/sqlsrv/shared/core_init.cpp:20:
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1752:29: warning: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Wvarargs]
va_start( print_params, warning );
^
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1749:120: note: parameter of type 'bool' is declared here
inline bool call_error_handler( Inout sqlsrv_context& ctx, In unsigned long sqlsrv_error_code TSRMLS_DC, In bool warning, ... )
^
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1761:29: warning: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Wvarargs]
va_start( print_params, warning );
^
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1758:120: note: parameter of type 'bool' is declared here
inline bool call_error_handler( Inout sqlsrv_context* ctx, In unsigned long sqlsrv_error_code TSRMLS_DC, In bool warning, ... )
^
2 warnings generated.
/bin/sh /private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/libtool --mode=compile g++ -std=c++11 -I. -I/private/tmp/pear/install/sqlsrv -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/include -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/main -I/private/tmp/pear/install/sqlsrv -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/private/tmp/pear/install/sqlsrv/shared/ -DHAVE_CONFIG_H -std=c++11 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector -c /private/tmp/pear/install/sqlsrv/shared/core_stmt.cpp -o shared/core_stmt.lo
g++ -std=c++11 -I. -I/private/tmp/pear/install/sqlsrv -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/include -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/main -I/private/tmp/pear/install/sqlsrv -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/private/tmp/pear/install/sqlsrv/shared/ -DHAVE_CONFIG_H -std=c++11 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector -c /private/tmp/pear/install/sqlsrv/shared/core_stmt.cpp -fno-common -DPIC -o shared/.libs/core_stmt.o
In file included from /private/tmp/pear/install/sqlsrv/shared/core_stmt.cpp:20:
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1752:29: warning: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Wvarargs]
va_start( print_params, warning );
^
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1749:120: note: parameter of type 'bool' is declared here
inline bool call_error_handler( Inout sqlsrv_context& ctx, In unsigned long sqlsrv_error_code TSRMLS_DC, In bool warning, ... )
^
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1761:29: warning: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Wvarargs]
va_start( print_params, warning );
^
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1758:120: note: parameter of type 'bool' is declared here
inline bool call_error_handler( Inout sqlsrv_context* ctx, In unsigned long sqlsrv_error_code TSRMLS_DC, In bool warning, ... )
^
/private/tmp/pear/install/sqlsrv/shared/core_stmt.cpp:2715:22: warning: expression result unused [-Wunused-value]
for( i; i < numInt && i < digits.size(); i++ ){
^
/private/tmp/pear/install/sqlsrv/shared/core_stmt.cpp:2720:26: warning: expression result unused [-Wunused-value]
for( i; i < numInt; i++ ){
^
/private/tmp/pear/install/sqlsrv/shared/core_stmt.cpp:2726:26: warning: expression result unused [-Wunused-value]
for( i; i < digits.size(); i++ ){
^
5 warnings generated.
/bin/sh /private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/libtool --mode=compile g++ -std=c++11 -I. -I/private/tmp/pear/install/sqlsrv -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/include -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/main -I/private/tmp/pear/install/sqlsrv -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/private/tmp/pear/install/sqlsrv/shared/ -DHAVE_CONFIG_H -std=c++11 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector -c /private/tmp/pear/install/sqlsrv/shared/core_util.cpp -o shared/core_util.lo
g++ -std=c++11 -I. -I/private/tmp/pear/install/sqlsrv -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/include -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/main -I/private/tmp/pear/install/sqlsrv -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/private/tmp/pear/install/sqlsrv/shared/ -DHAVE_CONFIG_H -std=c++11 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector -c /private/tmp/pear/install/sqlsrv/shared/core_util.cpp -fno-common -DPIC -o shared/.libs/core_util.o
In file included from /private/tmp/pear/install/sqlsrv/shared/core_util.cpp:22:
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1752:29: warning: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Wvarargs]
va_start( print_params, warning );
^
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1749:120: note: parameter of type 'bool' is declared here
inline bool call_error_handler( Inout sqlsrv_context& ctx, In unsigned long sqlsrv_error_code TSRMLS_DC, In bool warning, ... )
^
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1761:29: warning: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Wvarargs]
va_start( print_params, warning );
^
/private/tmp/pear/install/sqlsrv/shared/core_sqlsrv.h:1758:120: note: parameter of type 'bool' is declared here
inline bool call_error_handler( Inout sqlsrv_context* ctx, In unsigned long sqlsrv_error_code TSRMLS_DC, In bool warning, ... )
^
2 warnings generated.
/bin/sh /private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/libtool --mode=compile g++ -std=c++11 -I. -I/private/tmp/pear/install/sqlsrv -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/include -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/main -I/private/tmp/pear/install/sqlsrv -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/private/tmp/pear/install/sqlsrv/shared/ -DHAVE_CONFIG_H -std=c++11 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector -c /private/tmp/pear/install/sqlsrv/shared/FormattedPrint.cpp -o shared/FormattedPrint.lo
g++ -std=c++11 -I. -I/private/tmp/pear/install/sqlsrv -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/include -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/main -I/private/tmp/pear/install/sqlsrv -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/private/tmp/pear/install/sqlsrv/shared/ -DHAVE_CONFIG_H -std=c++11 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector -c /private/tmp/pear/install/sqlsrv/shared/FormattedPrint.cpp -fno-common -DPIC -o shared/.libs/FormattedPrint.o
/bin/sh /private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/libtool --mode=compile g++ -std=c++11 -I. -I/private/tmp/pear/install/sqlsrv -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/include -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/main -I/private/tmp/pear/install/sqlsrv -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/private/tmp/pear/install/sqlsrv/shared/ -DHAVE_CONFIG_H -std=c++11 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector -c /private/tmp/pear/install/sqlsrv/shared/localizationimpl.cpp -o shared/localizationimpl.lo
g++ -std=c++11 -I. -I/private/tmp/pear/install/sqlsrv -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/include -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/main -I/private/tmp/pear/install/sqlsrv -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/private/tmp/pear/install/sqlsrv/shared/ -DHAVE_CONFIG_H -std=c++11 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector -c /private/tmp/pear/install/sqlsrv/shared/localizationimpl.cpp -fno-common -DPIC -o shared/.libs/localizationimpl.o
/bin/sh /private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/libtool --mode=compile g++ -std=c++11 -I. -I/private/tmp/pear/install/sqlsrv -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/include -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/main -I/private/tmp/pear/install/sqlsrv -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/private/tmp/pear/install/sqlsrv/shared/ -DHAVE_CONFIG_H -std=c++11 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector -c /private/tmp/pear/install/sqlsrv/shared/StringFunctions.cpp -o shared/StringFunctions.lo
g++ -std=c++11 -I. -I/private/tmp/pear/install/sqlsrv -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/include -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/main -I/private/tmp/pear/install/sqlsrv -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/private/tmp/pear/install/sqlsrv/shared/ -DHAVE_CONFIG_H -std=c++11 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector -c /private/tmp/pear/install/sqlsrv/shared/StringFunctions.cpp -fno-common -DPIC -o shared/.libs/StringFunctions.o
/bin/sh /private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/libtool --mode=link cc -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/include -I/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/main -I/private/tmp/pear/install/sqlsrv -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/private/tmp/pear/install/sqlsrv/shared/ -DHAVE_CONFIG_H -g -O2 -o sqlsrv.la -export-dynamic -avoid-version -prefer-pic -module -rpath /private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/modules conn.lo util.lo init.lo stmt.lo shared/core_conn.lo shared/core_results.lo shared/core_stream.lo shared/core_init.lo shared/core_stmt.lo shared/core_util.lo shared/FormattedPrint.lo shared/localizationimpl.lo shared/StringFunctions.lo -Wl,-bind_at_load -lstdc++ -lodbc -lodbcinst
cc ${wl}-undefined ${wl}dynamic_lookup -o .libs/sqlsrv.so -bundle .libs/conn.o .libs/util.o .libs/init.o .libs/stmt.o shared/.libs/core_conn.o shared/.libs/core_results.o shared/.libs/core_stream.o shared/.libs/core_init.o shared/.libs/core_stmt.o shared/.libs/core_util.o shared/.libs/FormattedPrint.o shared/.libs/localizationimpl.o shared/.libs/StringFunctions.o -lstdc++ -lodbc -lodbcinst -Wl,-bind_at_load
dsymutil .libs/sqlsrv.so || :
warning: no debug symbols in executable (-arch x86_64)
creating sqlsrv.la
(cd .libs && rm -f sqlsrv.la && ln -s ../sqlsrv.la sqlsrv.la)
/bin/sh /private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/libtool --mode=install cp ./sqlsrv.la /private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/modules
cp ./.libs/sqlsrv.so /private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/modules/sqlsrv.so
cp ./.libs/sqlsrv.lai /private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/modules/sqlsrv.la

Libraries have been installed in:
/private/tmp/pear/install/pear-build-rootdOF37r/sqlsrv-5.2.0/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:

  • add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable
    during execution

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.

Build complete.
Don't forget to run 'make test'.

running: make INSTALL_ROOT="/private/tmp/pear/install/pear-build-rootdOF37r/install-sqlsrv-5.2.0" install
Installing shared extensions: /private/tmp/pear/install/pear-build-rootdOF37r/install-sqlsrv-5.2.0/usr/lib/php/extensions/no-debug-non-zts-20160303/
running: find "/private/tmp/pear/install/pear-build-rootdOF37r/install-sqlsrv-5.2.0" | xargs ls -dils
8597851860 0 drwxr-xr-x 3 root wheel 96 3 Abr 15:08 /private/tmp/pear/install/pear-build-rootdOF37r/install-sqlsrv-5.2.0
8597852388 0 drwxr-xr-x 3 root wheel 96 3 Abr 15:08 /private/tmp/pear/install/pear-build-rootdOF37r/install-sqlsrv-5.2.0/usr
8597852389 0 drwxr-xr-x 3 root wheel 96 3 Abr 15:08 /private/tmp/pear/install/pear-build-rootdOF37r/install-sqlsrv-5.2.0/usr/lib
8597852390 0 drwxr-xr-x 3 root wheel 96 3 Abr 15:08 /private/tmp/pear/install/pear-build-rootdOF37r/install-sqlsrv-5.2.0/usr/lib/php
8597852391 0 drwxr-xr-x 3 root wheel 96 3 Abr 15:08 /private/tmp/pear/install/pear-build-rootdOF37r/install-sqlsrv-5.2.0/usr/lib/php/extensions
8597852392 0 drwxr-xr-x 3 root wheel 96 3 Abr 15:08 /private/tmp/pear/install/pear-build-rootdOF37r/install-sqlsrv-5.2.0/usr/lib/php/extensions/no-debug-non-zts-20160303
8597852393 640 -rwxr-xr-x 1 root wheel 326416 3 Abr 15:08 /private/tmp/pear/install/pear-build-rootdOF37r/install-sqlsrv-5.2.0/usr/lib/php/extensions/no-debug-non-zts-20160303/sqlsrv.so

Build process completed successfully
Installing '/usr/lib/php/extensions/no-debug-non-zts-20160303/sqlsrv.so'
ERROR: failed to write /usr/lib/php/extensions/no-debug-non-zts-20160303/sqlsrv.so (copy(/usr/lib/php/extensions/no-debug-non-zts-20160303/sqlsrv.so): failed to open stream: Operation not permitted)

And, didn't work. The sos files wasn't created.

@nohnaimer
Copy link
Author

nohnaimer commented Apr 4, 2018

@heberfomin
But - Build process completed successfully, that is, the compilation was successful! On /private/tmp/pear/install/pear-build-rootdOF37r/install-sqlsrv-5.2.0/usr/lib/php/extensions/no-debug-non-zts-20160303/ must be files sqlsrv.so and pdo_sqlsrv.so

ERROR: failed to write /usr/lib/php/extensions/no-debug-non-zts-20160303/sqlsrv.so
You need sudo on compile:
$ sudo pecl install sqlsrv pdo_sqlsrv
Or need create dir /usr/lib/php/extensions/no-debug-non-zts-20160303/:
$ mkdir -p /usr/lib/php/extensions/no-debug-non-zts-20160303/
And after check whether there are lines (extension = sqlsrv.so and extension = pdo_sqlsrv.so) in the file php.ini

@heberfomin
Copy link

@nohnaimer and @yitam:
Thanks a lot for your help.
Finally I figure out what the problem was: Sistems Integrity Protection of mac.
Once I disabled it, runs ok.
Again,
Thank you guys !

@yitam
Copy link
Contributor

yitam commented Apr 10, 2018

hi @heberfomin, glad to hear you have figured out the root cause of the problems, System Integrity Protection on your Mac.

@danielflippance
Copy link

I've noticed that not only does System Integrity Protection need to be turned off in order to install the sqlsvr driver on Mac, it also needs to be turned off in order to use that driver.

System Integrity Protection is an important security measure to prevent the root account being abused, so is there any way to use the driver with SIP turned back back on after the driver is installed?

@david-puglielli
Copy link
Contributor

@danielflippance Could you provide some more info? Which version of macOS are you using? What errors do you get if you try to install and use the driver with SIP enabled?

@danielflippance
Copy link

danielflippance commented Mar 29, 2019

@david-puglielli I'm running Mac OS Mohave 10.14.3 (18D109)
I didn't see any errors when installing the SQL driver. The problem happens when trying to connect to SQL Server after the driver is installed.

The connection code is:
(I'm using PHP 7.3 with namespaces, hence the preceding slash)

if (function_exists('\sqlsrv_connect')) {
	$connection = \sqlsrv_connect($serverName, $connectionInfo);
} else {
	error_log('DEBUG sqlsrv_connect not found.');
}

With SIP turned off it calls the function sqlsrv_connect and connects.
With SIP turned on, that function is not found:

[29-Mar-2019 17:39:13 UTC] DEBUG sqlsrv_connect not found.

@david-puglielli
Copy link
Contributor

That is quite strange. Is PHP loading the drivers correctly? Try php -m and php --ri sqlsrv to verify that the drivers are loaded. Also, do sqlcmd and isql work when SIP is enabled?

@david-puglielli
Copy link
Contributor

@danielflippance Do you have any updates about your SIP issue for us?

@david-puglielli
Copy link
Contributor

@danielflippance How did you install PHP 7.3? Also, could you provide a PHP script showing how you use namespaces with our driver?

@danijmurcia
Copy link

Hi @dalovar ,

Glad you could get the driver working. Feel free to open a new issue if you have any other questions.

Can you install sql server for php version 5.6.40?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests