php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24023 Extension issues with mssql / sybase_ct
Submitted: 2003-06-04 12:19 UTC Modified: 2003-06-07 14:29 UTC
From: andrew at solutionsfirst dot com dot au Assigned:
Status: Closed Package: PEAR related
PHP Version: 4.3.1 OS: Debian/GNU Linux
Private report: No CVE-ID: None
 [2003-06-04 12:19 UTC] andrew at solutionsfirst dot com dot au
Hi,

On a plain vanilla i386 Debian system I've installed apache, php4, php4-pear and php4-sybase via apt-get. While native PHP functions for MSSQL work fine, connections to a database via PEAR DB abstraction reports "DB Error: extension not found". The DSN string starts as "mssql://".

At /usr/share/pear/DB/mssql.php:56, the following line incorrect because mssql.so nor sybase.so are ever installed via Debian packages to my knowledge; only sybase_ct.so. 

    if (!DB::assertExtension('mssql') &&
        !DB::assertExtension('sybase'))

Using the following replacement line seems to correct the problem for me.

    if (!DB::assertExtension('sybase_ct'))

This may be a Debian packaging issue only, but I'm not certain.

Thanks,

- Andrew

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-06-04 14:33 UTC] mw21st@php.net
Hi Andrew,

I´m not a PEAR::DB developer, so this is not an "official" answer, but just a tip:
Recompile your PHP with the option --with-mssql instead of --with-sybase_ct. Using the Sybase extension against an MSSQL server is possible, but sooner or later you´re going to run into compatibility issues.

Another option is to take a look at http://odbtp.sourceforge.net/ where you will find the best extension ATM to connect against MSSQL - it requires to install an additional component on the SQL server machine, though.

PEAR::DB´s MSSQL driver expects the MSSQL extension to function properly. Haven´t tested it with ODBTP yet. You won´t be able to use the tableInfo() method if you´re using Sybase. You might run into trouble using DB_FETCHMODE_ASSOC if you´re using Sybase.

You have been warned :-)

HTH,
 Markus
 [2003-06-07 02:19 UTC] andrew at solutionsfirst dot com dot au
Markus,

Thanks very much for your comment. I will certainly try re-compiling PHP but had secretly hoped there was going to be a [Debian] packaged solution :-)

And yes, I had already experienced issues with DB_FETCHMODE_ASSOC, but thought I was on crack.

Cheers,

- Andrew
 [2003-06-07 14:29 UTC] mw21st@php.net
Fine then - good luck ;-)
Keep in mind that compiling using --with-mssql on Unix/Linux requires at least PHP 4.3.0 and, additionally, FreeTDS (which you should already have installed, as it´s used by the Sybase extension as well).

I´m closing the bug for now.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 03:01:27 2024 UTC