The officially official Devuan Forum!

You are not logged in.

#1 2020-11-02 11:01:53

ftusc
Member
Registered: 2020-07-03
Posts: 12  

php and sql server

I want connect to sql server database with php.
In the past (Devuan jessie) I had used with php5 mssql library (removed with php 7.0).
https://www.php.net/manual/es/function. … onnect.php

Until a few days ago with Devuan ascii (php 7.0) I had used pdo sqlite without problems.
https://www.php.net/manual/en/ref.pdo-dblib.php

I upgrade to Beowulf (php 7.3) but now don't work it. I've found a way to make it work with pdo-odbc.
https://www.php.net/manual/en/ref.pdo-sqlsrv.php

Unfortunately this library don't permit me to use prepared statements (php script return segmentation fault!),
use "getColumnMeta" to get column name and so on.

What to do?

I cannot install php7.0 in beuwulf. It is not present.

Microsoft SQL Server Driver for PHP for me don't work:
https://www.php.net/manual/en/book.sqlsrv.php
I tried to execute step by step installation and configuration but don't work.

How to do?

Offline

#2 2020-11-05 21:01:06

xinomilo
Unknown
Registered: 2017-07-02
Posts: 315  

Re: php and sql server

usually stay away from M$ products, so never tried it, but maybe this helps :
https://github.com/microsoft/msphpsql/b … 8-9-and-10

Offline

#3 2020-11-05 21:32:37

golinux
Administrator
Registered: 2016-11-25
Posts: 3,317  

Re: php and sql server

Please check out this thread for updated php.

Offline

#4 2020-11-09 11:35:46

ftusc
Member
Registered: 2020-07-03
Posts: 12  

Re: php and sql server

Thanks a lot.
Unfortunately for me this and other link don't work.
It only works when use PDO via ODBC via SQLSRV.

M$ products sucks me too. Unfortunately I have to interface with it at work.
Instead mysql and other free software databases integration works like a charm!

Last edited by ftusc (2020-11-09 11:36:25)

Offline

#5 2021-02-20 14:50:45

mckaygerhard
Member
Registered: 2017-04-21
Posts: 283  
Website

Re: php and sql server

ftusc wrote:

Thanks a lot.
Unfortunately for me this and other link don't work.
It only works when use PDO via ODBC via SQLSRV.

M$ products sucks me too. Unfortunately I have to interface with it at work.
Instead mysql and other free software databases integration works like a charm!

but more miscinformation.. the problem are two..

1. you need updated odbc fixed from freedts and correct odbc ini file.. there's some changes that i already send to "freddy77" but stil is happened as https://github.com/FreeTDS/freetds/issues/372, check if your problem is related to MARS or cicled/anidated querys

2. php packages from sury and tdenetworks now has some problems, i corrected only php5.6 ones.. if you use php5.6 here are the solution: https://t.me/vegnuli/361 by addiding :

echo 'deb http://download.opensuse.org/repositories/home:/vegnuli:/lamp-vnx/Debian_10/ /' > /etc/apt/sources.list.d/home:vegnuli:lamp-vnx.list

curl -fsSL https://download.opensuse.org/repositories/home:vegnuli:lamp-vnx/Debian_10/Release.key | gpg --dearmor | tee /etc/apt/trusted.gpg.d/home_vegnuli_lamp-vnx.gpg > /dev/null

apt update
apt install php5.6 (etc etc)

Last edited by mckaygerhard (2021-02-20 14:51:38)

Offline

Board footer