Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

php connect to mssql

113 views
Skip to first unread message

Ferenc Radics

unread,
Jul 18, 2017, 3:30:07 AM7/18/17
to
hello

I have a debian 8.6 server:

root@xy:/# uname -a
Linux xy 3.16.0-4-amd64 #1 SMP Debian 3.16.43-2+deb8u2 (2017-06-26) x86_64 GNU/Linux

With php (5.6.30) I would like to connect to a mssql database that is on my local network but i get this error message in my apache error log:
PHP Fatal error:  Call to undefined function mssql_connect()...

In phpinfo I didn't find sqlsrv so I thought i just need a php mssql package. I found "php5-sybase". I tried to install it but apt-get gives me this error message:
The following packages have unmet dependencies:
 php5-sybase : Depends: libsybdb5 (>= 0.63) but it is not installable
E: Unable to correct problems, you have held broken packages.

I tried to google it but I cannot find any usable answer. Please give me some hint on what could I do.

thanks,
Ferenc

Greg Wooledge

unread,
Jul 18, 2017, 8:30:06 AM7/18/17
to
On Tue, Jul 18, 2017 at 09:23:20AM +0200, Ferenc Radics wrote:
> The following packages have unmet dependencies:
> php5-sybase : Depends: libsybdb5 (>= 0.63) but it is not installable
> E: Unable to correct problems, you have held broken packages.

The bit about "held broken packages" is not reassuring. Did you try
"apt-get -f install" yet? (If it wants to remove things you don't
want removed, say no.)

If that doesn't fix it, show us the output of these commands:

apt-cache policy
apt-cache policy php5-sybase
apt-cache policy libsybdb5
cat /etc/apt/sources.list

My suspicion is that you've got an incomplete or inconsistent sources.list
which is somehow trying to pull php5-sybase from jessie, but libsybdb5
from somewhere else.

Ferenc Radics

unread,
Jul 18, 2017, 9:50:06 AM7/18/17
to
Yes I tried apt-get -f install. It did nothing: "0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded."


root@xy:/# apt-cache policy
Package files:
 100 /var/lib/dpkg/status
     release a=now
 500 http://security.debian.org/ jessie/updates/main Translation-en
 500 http://security.debian.org/ jessie/updates/contrib Translation-en
 500 http://security.debian.org/ jessie/updates/contrib amd64 Packages
     release v=8,o=Debian,a=oldstable,n=jessie,l=Debian-Security,c=contrib
     origin security.debian.org
 500 http://security.debian.org/ jessie/updates/main amd64 Packages
     release v=8,o=Debian,a=oldstable,n=jessie,l=Debian-Security,c=main
     origin security.debian.org
 500 cdrom://[Debian GNU/Linux 8.6.0 _Jessie_ - Official amd64 DVD Binary-1 2016                                                          0917-14:25]/ jessie/main Translation-en
 500 cdrom://[Debian GNU/Linux 8.6.0 _Jessie_ - Official amd64 DVD Binary-1 2016                                                          0917-14:25]/ jessie/contrib Translation-en
 500 cdrom://[Debian GNU/Linux 8.6.0 _Jessie_ - Official amd64 DVD Binary-1 2016                                                          0917-14:25]/ jessie/main amd64 Packages
     origin Debian GNU/Linux 8.6.0 _Jessie_ - Official amd64 DVD Binary-1 201609                                                          17-14:25
 500 cdrom://[Debian GNU/Linux 8.6.0 _Jessie_ - Official amd64 DVD Binary-1 2016                                                          0917-14:25]/ jessie/contrib amd64 Packages
     origin Debian GNU/Linux 8.6.0 _Jessie_ - Official amd64 DVD Binary-1 201609                                                          17-14:25
Pinned packages:
root@xy:/#


root@xy:/# apt-cache policy php5-sybase
php5-sybase:
  Installed: (none)
  Candidate: 5.6.30+dfsg-0+deb8u1
  Version table:
     5.6.30+dfsg-0+deb8u1 0
        500 http://security.debian.org/ jessie/updates/main amd64 Packages
root@xy:/#


root@xy:/# apt-cache policy libsybdb5
libsybdb5:
  Installed: (none)
  Candidate: (none)
  Version table:
root@xy:/#


root@xy:/# cat /etc/apt/sources.list
#deb cdrom:[Debian GNU/Linux 8.6.0 _Jessie_ - Official amd64 DVD Binary-1 20160917-14:25]/ jessie contrib main

deb cdrom:[Debian GNU/Linux 8.6.0 _Jessie_ - Official amd64 DVD Binary-1 20160917-14:25]/ jessie contrib main

deb http://security.debian.org/ jessie/updates main contrib
deb-src http://security.debian.org/ jessie/updates main contrib

# jessie-updates, previously known as 'volatile'
# A network mirror was not selected during install.  The following entries
# are provided as examples, but you should amend them as appropriate
# for your mirror of choice.
#
# deb http://ftp.debian.org/debian/ jessie-updates main contrib
# deb-src http://ftp.debian.org/debian/ jessie-updates main contrib

Greg Wooledge

unread,
Jul 18, 2017, 9:50:06 AM7/18/17
to
On Tue, Jul 18, 2017 at 03:41:10PM +0200, Ferenc Radics wrote:
> root@xy:/# apt-cache policy libsybdb5
> libsybdb5:
> Installed: (none)
> Candidate: (none)
> Version table:

> root@xy:/# cat /etc/apt/sources.list
> #deb cdrom:[Debian GNU/Linux 8.6.0 _Jessie_ - Official amd64 DVD Binary-1
> 20160917-14:25]/ jessie contrib main
>
> deb cdrom:[Debian GNU/Linux 8.6.0 _Jessie_ - Official amd64 DVD Binary-1
> 20160917-14:25]/ jessie contrib main
>
> deb http://security.debian.org/ jessie/updates main contrib
> deb-src http://security.debian.org/ jessie/updates main contrib

Your sources.list is incomplete. All you have are one DVD and the
security updates, but not a regular Internet mirror for the rest of
the Debian packages that aren't on your DVD.

Assuming this machine actually *has* Internet connectivity, what you
want to do is add a regular Internet mirror (and then probably also
comment out the DVD line, unless you like being prompted to insert
the DVD to save bandwidth).

For example:

deb http://deb.debian.org/debian/ jessie main contrib
deb-src http://deb.debian.org/debian/ jessie main contrib

deb http://security.debian.org/ jessie/updates main contrib
deb-src http://security.debian.org/ jessie/updates main contrib


If the machine does *not* have Internet connectivity, then you're going
to have to sneakernet the libsybdb5 package onto it manually. Plus
any other packages that are needed, but which aren't on your DVD.

Ferenc Radics

unread,
Jul 18, 2017, 10:10:06 AM7/18/17
to
Thank you Greg! It is working now! Thank you for the detailed explanation. Have a good day :)
0 new messages