Jump to content

[SOLVED] using sybase with php


davemere

Recommended Posts

Hello phpfreaks,

 

I'm trying to use a sybase database with php-5 and am having a few problems with simply connecting. Here is what I've done so far:

 

1) Copied php_sybase_ct.dll to PHP/ext

2) Added

[php_SYBASE]
extension=php_sybase_ct.dll

to php.ini

3) Restarted Apache

 

and still I get this . . .

 

Fatal error: Call to undefined function sybase_connect() in C:\www\sybase.php on line 9

 

So, can anyone suggest what I'm missing?

 

Thanks, Dave

Link to comment
Share on other sites

Hi there guys, thanks for answering

 

Are you sure that the php.ini that php is using is the one you are changing?

php.ini is in Program Files/PHP. There are no other installations as far as I know! I found an old php-ini file in my profile and deleted it, restarted Apache, same result! How can I check that this is the file is being used?

 

Also, does the php.ini extension_dir = setting point to the php\ext folder?

php.ini contains this line extension_dir="C:\Program Files\PHP\ext" - seems to be doing the job

 

I think if I am right you'll need to install the sybase client on the php server to gain access. not too sure tho

Ugh is that reinstalling Sybase? Don't fancy that much. What does this actually mean? Install Sybase to c:program files/php? Is there a config file I could change instead?

 

 

Link to comment
Share on other sites

Create a .php file with the following and browse to it -

 

<?php
phpinfo();
?>

 

Near the top of the output there is a line that lists the actual php.ini that is being used (if any.)

 

You can also scroll or search the output to see what the extension_dir setting is and if the sybase extension is getting loaded.

 

Also, check your web server log for errors to see if any additional information is being provided.

Link to comment
Share on other sites

Ok here we go .  ..

 

Near the top of the output there is a line that lists the actual php.ini that is being used (if any.)

php.ini is indeed C:\Program Files\PHP\php.ini

 

You can also scroll or search the output to see what the extension_dir setting is and if the sybase extension is getting loaded.

extension_dir is indeed C:\Program Files\PHP\ext

as for sybase extension I'm not entirely sure. I can't see a seperate table for sybase, unlike mysql

In the environment table we do have: 

SCROOT =  C:\sybase\Shared\Sybase Central 4.3

and a few other sybase related variables which are correct as far as I know. I can check with our DBA.

 

Also, check your web server log for errors to see if any additional information is being provided.

 

Ah ha, this looks like the one. Error message created on Apache startup is:

PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\\Program Files\\PHP\\ext\\php_sybase_ct.dll' - The specified module could not be found.\r\n in Unknown on line 0

 

I confess I don't entirely understand this error. That file is definitely there, and named as listed above. Opening the dll just gives me machine code type stuff.

 

Does this shed any light?

 

 

Link to comment
Share on other sites

Bit of an update...found a thread mentioning some companion DLLs required by php_sybase_ct.dll

 

These files are called libeay32 and ssleay32. Unfortunately the thread descends into a bit of an argument so isn't very helpful!

 

http://groups.google.co.uk/group/comp.lang.php/browse_thread/thread/c102172dfb353c78/2833e9b9121d7199?hl=en&lnk=st&q=%2Bphp_sybase_ct.dll#2833e9b9121d7199

 

tsk tsk.

 

Perhaps if I put it another way. Is or has anyone used php successully with Sybase? If so, what did you do to install that I haven't?

 

Cheers, Dave

Link to comment
Share on other sites

Ok . . . returning to this problem, I've discovered a few threads around that state I need Sybase Client Libraries to connect to sybase, either directly or through ODBC. To be honest I wouldn't care which one as long as I can do it.

 

Compiling a definite list of these .dlls has been tricky. I know they at least contain:

 

libcs.dll

libct.dll

apphelp.dll

 

If anyone is successfully using php with Sybase, could you please take a look at the .dlls you use (they should be in the php folder or php/ext folder) and see if you have these? Someone must be having more luck than me here!

 

Many thanks, please contact me if I can give any more info!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.