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
Comments
@nohnaimer Check out sqlshim: https://github.com/radsectors/sqlshim. |
Hi @nohnaimer, |
When I try to install sqlsrv and sqlsrv pdo in Mac (MAMP) using the link @ulvii I receive the errors: Best bet is probably using sqlshim for local testing in Mac, and then testing on the online servers |
Hi @dalovar , Drivers are Mac-compatible starting from 4.1.7preview release. For the latest version you would run:
|
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 $ sudo pear config-set php_ini But better put the latest version of 4.2.0preview Question: How to upgrade 4.1.7 to 4.2.0? |
Hi @nohnaimer ,
|
Installing
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. |
@dalovar , Please post the output of the following commands:
|
|
php -v
The PHP version most likely the problem. I found another issue with a similar error here: #373 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! |
Hi @dalovar , Glad you could get the driver working. Feel free to open a new issue if you have any other questions. |
I have also updated the php version, but still I am unable to install sqlsrv driver. |
@techsavvyashish everything is fine on php 7.1.8 and I update for 4.3.0 sqlsrv release. You are clearly doing something wrong! |
Hope this help: sudo CXXFLAGS="-I/usr/local/opt/unixodbc/include" LDFLAGS="-L/usr/local/lib" pecl install pdo_sqlsrv added the .so libraries as result inside /etc/php.ini |
@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. |
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 and the sqlsrv.so is not available and not appear in phpinfo() somebody could help me? |
You need to reboot your mac and press ⌘+R when booting up. Then go into Utilities > Terminal and type the following commands: csrutil disable |
Hi guys, I need some help installing PDO SQL Server drivers for Mac OS X. 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? |
Put the php.ini content in the php.ini loaded by php
Get Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
From: João Neves <notifications@github.com>
Sent: Monday, November 20, 2017 4:47:40 AM
To: Microsoft/msphpsql
Cc: Víctor Chávez; Mention
Subject: Re: [Microsoft/msphpsql] How to SQLSRV Driver on Mac OS X (#198)
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?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#198 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AcMDTdusFtzUSrT9ekYO9iYEYV-7oeE2ks5s4WbcgaJpZM4LJowQ>.
|
I just created a video to install sqlsrv for MAMP on mac: |
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/ |
hi @nohnaimer: $ 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: Do you know how can I fix it? |
Hi @heberfomin |
Hi @heberfomin |
@nohnaimer |
@heberfomin php installed and work
|
I tried again as you suggest. WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update creating libtool
|
@heberfomin ERROR: failed to write /usr/lib/php/extensions/no-debug-non-zts-20160303/sqlsrv.so |
@nohnaimer and @yitam: |
hi @heberfomin, glad to hear you have figured out the root cause of the problems, System Integrity Protection on your Mac. |
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? |
@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? |
@david-puglielli I'm running Mac OS Mohave 10.14.3 (18D109) The connection code is:
With SIP turned off it calls the function
|
That is quite strange. Is PHP loading the drivers correctly? Try |
@danielflippance Do you have any updates about your SIP issue for us? |
@danielflippance How did you install PHP 7.3? Also, could you provide a PHP script showing how you use namespaces with our driver? |
Can you install sql server for php version 5.6.40? |
Hello,
Are there manual how to run sqlsrv driver on Mac OS X with brew installed php 7?
Any help?
Thank you!
The text was updated successfully, but these errors were encountered: