Comments (26)
I'll have to look into it, I'm not too familiar with how pecl works, but it looks like it grabbed wrong .so files
from msphpsql.
Does the file exist? /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20200930/sqlsrv.so
I mean? If it exists, then it would suggest that there be some dependency issue or architecture mismatch (ARM vs x86)
from msphpsql.
yes, it is exist.
here is my screenshots
from msphpsql.
It looks like the PHP driver can't find/load unixODBC. Is this an ARM(M1) Mac or x86? I think I saw a similar issue on ARM Macs when using pyODBC.
from msphpsql.
I'm using ARM(M2). Is there any solution to solve this issue?
from msphpsql.
Do you have an ODBC driver installed? Like msodbcsql18 and if so, does it work without pyODBC?
Something like this, assuming ODBC Driver 18 is installed:
isql -v -k "DRIVER={ODBC Driver 18 for SQL Server};SERVER=...;UID=...;PWD=..."
from msphpsql.
I followed the doc instruction for mac. And I install the unixODBC 2.3.12. do I have to install pyodbc?
I've tried
isql -v -k "DRIVER={ODBC Driver 18 for SQL Server};SERVER=localhost;UID=sa;PWD=..."
but the output is like this
[08001][Microsoft][ODBC Driver 18 for SQL Server]SSL Provider: [OpenSSL library could not be loaded, make sure OpenSSL 1.0, 1.1, or 3.0 is installed]
[08001][Microsoft][ODBC Driver 18 for SQL Server]Client unable to establish connection. For solutions related to encryption errors, see https://go.microsoft.com/fwlink/?linkid=2226722
[ISQL]ERROR: Could not SQLDriverConnect
I've tried to use the azure data studio and it is connected
am I wrong with isql
command line?
from msphpsql.
No pyODBC is a separate thing, but people were having a similar sounding issue there. So it seems like the ODBC driver is failing to find or load OpenSSL. Can you post the rsult of following commands?
ls -l /opt/homebrew/opt/openssl/lib/
and ls -l /opt/local/lib/
from msphpsql.
No such file or directory, do I have to install the openssl?
gilangpratama@Gilangs-MacBook-Air nodejs-projects % ls -l /opt/homebrew/opt/openssl/lib/
ls: /opt/homebrew/opt/openssl/lib/: No such file or directory
gilangpratama@Gilangs-MacBook-Air nodejs-projects % ls -l /opt/local/lib/
ls: /opt/local/lib/: No such file or directory
from msphpsql.
How was the ODBC Driver 18 (msodbcsql18) installed? Was it via Homebrew? If you run odbcinst -j
it should show something like:
DRIVERS............: /path/to/odbcinst.ini
SYSTEM DATA SOURCES: /path/to/odbc.ini
Can you tell me what's in the odbcinst.ini (cat /path/to/odbcinst.ini
)?
It's strange that the driver is there, but a compatible OpenSSL isn't, I'll ask around on my end about it as well.
from msphpsql.
Yes I installed the unixODBC. here is my cli result
gilangpratama@Gilangs-MacBook-Air nodejs-projects % odbcinst -j
unixODBC 2.3.12
DRIVERS............: /opt/homebrew/etc/odbcinst.ini
SYSTEM DATA SOURCES: /opt/homebrew/etc/odbc.ini
FILE DATA SOURCES..: /opt/homebrew/etc/ODBCDataSources
USER DATA SOURCES..: /Users/gilangpratama/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8
gilangpratama@Gilangs-MacBook-Air nodejs-projects % cat /opt/homebrew/etc/odbcinst.ini
[ODBC Driver 18 for SQL Server]
Description=Microsoft ODBC Driver 18 for SQL Server
Driver=/opt/homebrew/lib/libmsodbcsql.18.dylib
UsageCount=1
from msphpsql.
Curious, given that OpenSSL is a dependency of ODBC Driver 18, so how was it installed without it? Or was it deleted afterwards? Anyway you can try installing it with brew install openssl
and see if it fixes that isql
command.
from msphpsql.
I ran brew install openssl
and ran the isql
command. here is the output
gilangpratama@Gilangs-MacBook-Air nodejs-projects % brew install openssl
Running `brew update --auto-update`...
Installing from the API is now the default behaviour!
You can save space and time by running:
brew untap homebrew/core
==> Auto-updated Homebrew!
Updated 6 taps (jandedobbeleer/oh-my-posh, homebrew/cask-versions, homebrew/cask-fonts, homebrew/services, homebrew/core and homebrew/cask).
==> New Formulae
apify-cli codelimit libjcat python-lxml risor
bazel-diff counts libxmlb python-markupsafe roadrunner
bazel-remote goread [email protected] python-mutagen terraform-graph-beautifier
cargo-all-features hyfetch meson-python python-packaging toxiproxy
cargo-binutils imgdiet mgis python-pycurl udp2raw-multiplatform
cargo-deps imgdiff orbiton python-pyparsing vunnel
cdxgen kor python-click python-pyproject-hooks
cloud-sql-proxy ldid-procursus python-flit-core python-pytz
==> New Casks
hypercal piphero simple-web-server sparkplate updf viso whatsapp-legacy
You have 12 outdated formulae and 1 outdated cask installed.
Warning: openssl@3 3.1.2 is already installed and up-to-date.
To reinstall 3.1.2, run:
brew reinstall openssl@3
gilangpratama@Gilangs-MacBook-Air nodejs-projects % isql -v -k "DRIVER={ODBC Driver 18 for SQL Server};SERVER=localhost;UID=sa;PWD=..."
[08001][Microsoft][ODBC Driver 18 for SQL Server]SSL Provider: [OpenSSL library could not be loaded, make sure OpenSSL 1.0, 1.1, or 3.0 is installed]
[08001][Microsoft][ODBC Driver 18 for SQL Server]Client unable to establish connection. For solutions related to encryption errors, see https://go.microsoft.com/fwlink/?linkid=2226722
[ISQL]ERROR: Could not SQLDriverConnect
I think it is really weird. Now, I have 2 openssl
packages 👀
gilangpratama@Gilangs-MacBook-Air nodejs-projects % brew list
==> Formulae
autoconf gcc gmp isl libtool mpfr [email protected] postgresql@15 unixodbc
automake gdbm go krb5 lz4 msodbcsql18 openssl@3 [email protected] xz
ca-certificates gettext [email protected] lcov m4 mssql-tools18 pcre2 readline zlib
cmake git icu4c libmpc mpdecimal oh-my-posh pkg-config sqlite zstd
==> Casks
font-fira-code wine-stable
what should I do now?
from msphpsql.
I suspect this may be an architecture mismatch (ARM ODBC Driver but x86 OpenSSL, or something like that). Can you check a few things?
The location of x86 OpenSSL
ls -l /usr/local/opt/openssl/lib/
Which arch the ODBC driver is
ls -l /opt/homebrew/lib/libmsodbcsql.18.dylib
lipo -archs /opt/homebrew/lib/libmsodbcsql.18.dylib
And which arch the PHP driver is
ls -l /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20200930/sqlsrv.so
lipo -archs /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20200930/sqlsrv.so
from msphpsql.
sure
The location of x86 OpenSSL
gilangpratama@Gilangs-MacBook-Air ~ % ls -l /usr/local/opt/openssl/lib/
ls: /usr/local/opt/openssl/lib/: No such file or directory
Which arch the ODBC driver is
gilangpratama@Gilangs-MacBook-Air ~ % ls -l /opt/homebrew/lib/libmsodbcsql.18.dylib
lrwxr-xr-x 1 gilangpratama admin 56 Aug 25 08:41 /opt/homebrew/lib/libmsodbcsql.18.dylib -> ../Cellar/msodbcsql18/18.3.1.1/lib/libmsodbcsql.18.dylib
gilangpratama@Gilangs-MacBook-Air ~ % lipo -archs /opt/homebrew/lib/libmsodbcsql.18.dylib
arm64
And which arch the PHP driver is
gilangpratama@Gilangs-MacBook-Air ~ % ls -l /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20200930/sqlsrv.so
-rw-r--r-- 1 root admin 354984 Aug 25 13:48 /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20200930/sqlsrv.so
gilangpratama@Gilangs-MacBook-Air ~ % lipo -archs /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20200930/sqlsrv.so
x86_64
why the the sqlsrv.so to be x86_64 ?
from msphpsql.
Is there a chance you could run the pecl install commands again with a -v
option and save the output (might need to uninstall the current PHP driver before)? It is supposed to build the driver on the machine from source, so I'm surprised it would be building an x86 version on an ARM...
from msphpsql.
can you guide me how to install commands with a -v
?
I just following this tutorial
from msphpsql.
I'm looking into it, see if I can figure out why builds the wrong one
from msphpsql.
hi, is there any update on it?
from msphpsql.
I tried to reinstall, it is success but, there is a warning that maybe useful for you to debug this lib.
/private/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/pear/temp/sqlsrv/conn.cpp:160:84: warning: format specifies type 'long' but the argument has type 'zend_long' (aka 'long long') [-Wformat]
snprintf(temp_str, MAX_CONN_VALSTRING_LEN, "%s={%ld};", option->odbc_name, Z_LVAL_P(value));
~~~ ^~~~~~~~~~~~~~~
%lld
/Applications/XAMPP/xamppfiles/include/php/Zend/zend_types.h:796:28: note: expanded from macro 'Z_LVAL_P'
#define Z_LVAL_P(zval_p) Z_LVAL(*(zval_p))
^~~~~~~~~~~~~~~~~
/Applications/XAMPP/xamppfiles/include/php/Zend/zend_types.h:795:25: note: expanded from macro 'Z_LVAL'
#define Z_LVAL(zval)
from msphpsql.
I take it even after the reainstall sqlsrv.so is still x86?
from msphpsql.
Yes, it is still x86
gilangpratama@Gilangs-MacBook-Air ~ % lipo -archs /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20200930/sqlsrv.so
x86_64
from msphpsql.
Hey guys, uninstall the current version of pyodbc and re install from the source
pip install --no-binary :all: pyodbc
worked for me
from msphpsql.
Hey guys, uninstall the current version of pyodbc and re install from the source
pip install --no-binary :all: pyodbc
worked for me
What python/pip version do you use? I'll try that
from msphpsql.
Yes, it is still x86
gilangpratama@Gilangs-MacBook-Air ~ % lipo -archs /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20200930/sqlsrv.so x86_64
Don't use XAMPP. Switch to MAMP and follow these instructions
https://gist.github.com/queval-j/040128a4f307d0765fb08020dd47a2b8
from msphpsql.
Yes, it is still x86
gilangpratama@Gilangs-MacBook-Air ~ % lipo -archs /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20200930/sqlsrv.so x86_64
Don't use XAMPP. Switch to MAMP and follow these instructions https://gist.github.com/queval-j/040128a4f307d0765fb08020dd47a2b8
thanks, I'll try that
from msphpsql.
Related Issues (20)
- TrustServerCertificate no longer working in v5.11.1 HOT 9
- SQLSTATE[HY000]: [Microsoft][ODBC Driver 18 for SQL Server]Unicode conversion failed HOT 14
- CentOS9 SQL Server 2014 connect failed. Microsoft ODBC Driver 18 for SQL Server : TCP Provider: Error code 0x2746. HOT 6
- Cakephp2 Application takes longer time to fetch data from sql server database resulting php memory error HOT 3
- Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server HOT 1
- Memory leak in Microsoft ODBC Driver 17.10.5 for SQL Server HOT 4
- HY104 Invalid precision value when reusing prepared statement HOT 4
- SQLSTATE[01002] Adaptive Server connection failed (xxx.xx.xx.xxx) HOT 1
- Issue connecting to SQL server from Openshift HOT 1
- Unable to build version 5.12.0beta1 on Windows HOT 2
- New attribute for sql bigint and decimal/numeric types to php int and float types HOT 1
- Performance problem when using params on select query HOT 2
- Error on both ARM64 and AMD64 docker build HOT 1
- apt fails to install from pmc-geofence.trafficmanager.net: 403 Forbidden HOT 10
- Error requesting access token while Azure webapps (php) connect to Azure SQL server by UMI HOT 4
- Windows DLL available to download
- unable to install in ubuntu 22.04 container HOT 1
- SQL server connection HOT 6
- When will there be support for installing Ubuntu 24.04? HOT 1
- Error OpenSSL Shutdown while in init - cURL - MSSQL HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from msphpsql.