php + sybase

Pagina: 1
Acties:

Onderwerpen


  • jonaskellens
  • Registratie: November 2006
  • Laatst online: 30-05-2011
Ik probeer vanuit een php-pagina een verbinding te leggen met een sybase-database.

<?php
$db = sybase_connect('mijn_server','mijn_login','mijn_passw');
sybase_select_db(Admin,$db);
$sql = "select * FROM Admin";
sybase_query($sql);
?>

De melding die ik steeds krijg is :

Fatal error: Call to undefined function sybase_connect() in C:\wamp\www\testMedwan.php on line 2

Zoals u ziet maak ik gebruik van WAMPserver 2.

Het php-error-log vertelt :

PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.2.6/ext/php_sybase_ct.dll' - The specified module could not be found.

Echter in mijn php.ini-file staat volgende regel ongecommenteerd (heb ik manueel uit comment gebracht) :

extension=php_sybase_ct.dll

Als ik navigeer naar C:\wamp\bin\php\php5.2.6\ext dan zie ik deze map de benodigde .dll-file staan :
php_sybase_ct.dll

Tot slot heb ik dit gevonden en toegepast :

Step by step:
1) install Sybase Client your XP system's computer.
2) add your database name and ip in "sql.ini" file. (c:\SYBASE\ini\sql.ini )
3)open Wamp php.ini folder and add this line:
sybase.interface_file = "c:\SYBASE\ini\sql.ini"

So, you can connect Win XP to remote Sybase.
by turkiye_meteor


1. Sybase Central staat op mijn XP-laptop (waar ik in dreamweaver ook mijn php-connectie wil maken en testen) en ik ben daar geconnecteerd op de databank van mijn keuze.
2. in dit sql.ini file staat :
[JUNON]
master=TCP,192.168.4.170,5000
query=TCP,192.168.4.170,5000
3. in php.ini staat :
sybase.interface_file = "c:\SYBASE\ini\sql.ini"

Veel googlen heeft me tot hier gebracht.

Echter de melding blijft :

Fatal error: Call to undefined function sybase_connect() in C:\wamp\www\testMedwan.php on line 2

en php_error.log vermeldt :

PHP Fatal error: Call to undefined function sybase_connect() in C:\wamp\www\testMedwan.php on line 2

Ik weet niet of iemand hier ervaring heeft met php+sybase... ?

Maar zelf stopt het bij mij hier.

  • Megamind
  • Registratie: Augustus 2002
  • Laatst online: 10-09 22:45
Misschien kwestie van wamp even restarten?

Doe eens dit:
PHP:
1
phpinfo();

Staat daar wel de module tussen?

  • jonaskellens
  • Registratie: November 2006
  • Laatst online: 30-05-2011
Configure Command
cscript /nologo configure.js "--enable-snapshot-build" "--with-gd=shared" "--with-extra-includes=C:\Program Files (x86)\Microsoft SDK\Include;C:\PROGRA~2\MICROS~2\VC98\ATL\INCLUDE;C:\PROGRA~2\MICROS~2\VC98\INCLUDE;C:\PROGRA~2\MICROS~2\VC98\MFC\INCLUDE" "--with-extra-libs=C:\Program Files (x86)\Microsoft SDK\Lib;C:\PROGRA~2\MICROS~2\VC98\LIB;C:\PROGRA~2\MICROS~2\VC98\MFC\LIB"

Voor de rest staat sybase wel vaak in het PATH vermeldt van apache en php...

Maar "php_sybase_ct" staat er letterlijk niet in (via zoekfunctie van firefox).

WAMP heb ik na elke wijziging alle services herstart...

Acties:
  • 0 Henk 'm!

  • igmar
  • Registratie: April 2000
  • Laatst online: 03-09 22:58

igmar

ISO20022

Of te wel, zoals de search je had kunnen vertellen : php_sybase_ct.dll heeft DLL's nodig die jij niet op je systeem hebt staan. In jouw geval, waarschijnlijk libct.dll en libcs.dll

Acties:
  • 0 Henk 'm!

  • dvvelzen
  • Registratie: Februari 2002
  • Laatst online: 07-08 19:20
Misschien een beetje "far fetched", maar indien je ASE 15 gebruikt dan zijn de libct.lib e.d. kwa naam veranderd. Ze heten nu libsybct.dll e.d.

er staat een bat scriptje in je OCS directory die een copy met de oude naamgeving neerzet (heb je o.a. ook nodig voor sqsh in cygwin.)

%SYBASE%\%SYBASE_OCS%\scripts
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
bash-3.2$ cat copylibs.bat 
@ECHO OFF
REM  As of SDK 15.0 and Open Server 15.0, Sybase library names have
REM  changed from lib<name> to libsyb<name> to avoid name clashes
REM  with other libraries.
REM
REM  To allow pre-15.0 applications to continue to work with the
REM  renamed shared libraries, this script is provided to copy the
REM  new library names to the old ones in %SYBASE%\%SYBASE_OCS%\dll.
REM  Usage of the script:
REM 
REM     copylibs.bat { create / remove }
REM
REM  where 'create' copies the old-named files in $SYBASE/$SYBASE_OCS/dll
REM  and 'remove' can be used to delete these files again.

SET DLLDIR=%SYBASE%\%SYBASE_OCS%\dll

IF "%SYBASE%"=="" (
        ECHO %%SYBASE%% is not set.
        GOTO end
)

IF "%SYBASE_OCS%"=="" (
        ECHO %%SYBASE_OCS%% is not set.
        GOTO end
)

IF "%1"=="create" GOTO create
IF "%1"=="remove" GOTO remove
GOTO usage

:create
copy %DLLDIR%\libsybblk.dll %DLLDIR%\libblk.dll
copy %DLLDIR%\libsybcobct.dll %DLLDIR%\libcobct.dll
copy %DLLDIR%\libsybcs.dll %DLLDIR%\libcs.dll
copy %DLLDIR%\libsybct.dll %DLLDIR%\libct.dll
copy %DLLDIR%\libsybdb.dll %DLLDIR%\libdb.dll
copy %DLLDIR%\libsybsrv.dll %DLLDIR%\libsrv.dll
copy %DLLDIR%\libsybxadtm.dll %DLLDIR%\libxadtm.dll
GOTO end

:remove
del %DLLDIR%\libblk.dll
del %DLLDIR%\libcobct.dll
del %DLLDIR%\libcs.dll
del %DLLDIR%\libct.dll
del %DLLDIR%\libdb.dll
del %DLLDIR%\libsrv.dll
del %DLLDIR%\libxadtm.dll
GOTO end

:usage
ECHO Usage: %0 { create / remove }

:end
bash-3.2$

[ Voor 73% gewijzigd door dvvelzen op 19-09-2008 10:14 ]