The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
sybase connection through shell-script Amitabh UNIX for Dummies Questions & Answers 9 04-10-2009 11:34 PM
Connect to a Remote Sybase Server Through Script Aparna_k82 Shell Programming and Scripting 3 02-17-2006 11:59 AM
Connect to a Remote Sybase Server Through Script. Aparna_k82 Windows & DOS: Issues & Discussions 2 06-23-2005 12:26 PM
remote connection preetham UNIX for Advanced & Expert Users 5 10-02-2002 07:59 AM
I need remote connection help noobie_doo UNIX for Dummies Questions & Answers 2 02-12-2002 05:51 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-20-2004
lealyz lealyz is offline
Registered User
  
 

Join Date: Dec 2001
Location: Lagos, Nigeria
Posts: 41
remote sybase connection and php error.

Hi all,

I am trying to connect to a remote sybase database server (sitting on windows) from my freebsd apache webserver.
My Webserver has installed;

Apache2.0
PHP 4.3.8
Freetds with ODBC enables ( tsql works but isql doesnt )
unixODBC
syabse-ocsd

When i connect with tsql from command line, i am able to connect to my remote server. When i try to connect with isql i get this:

/usr/local/bin/isql -v my_remote_ip username password
[S1000][unixODBC][FreeTDS][SQL Server]Unable to connect to data source
[ISQL]ERROR: Could not SQLConnect

Then i also wrote a php script to connec to the sybase server, my script looks like this:

<?php
echo "hi";
$lnk=sybase_connect('ip_address:5000','username','password') or die
("no luck chuck!");
echo "connected<br>";
sybase_close($lnk);
?>

BUt whenever i try to connect with it, i get this error:

hi
Fatal error: Call to undefined function: sybase_connect() in /htdocs/test/sybase_conn.php on line 3


Now, i got the sybase_ct.so file after i set php --with-sybase-ct=shared, usr/local .
Now in php.ini, i have the following lines:

extension = sybase_ct.so
extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20020429/"
sybase.interface_file = "/usr/local/sybase/interfaces"


I read it up somewhere that i need to log in as webserver user: nobody and get connected with isql before it works. I tried that but i got the same error message as i get when i am connected as root:

/usr/local/bin/isql -v my_remote_ip username password
[S1000][unixODBC][FreeTDS][SQL Server]Unable to connect to data source
[ISQL]ERROR: Could not SQLConnect

I am really short of ideas, i need help on a way to effect my php connection successfully.

Lealyz.
  #2 (permalink)  
Old 08-20-2004
RTM's Avatar
RTM RTM is offline Forum Advisor  
Hog Hunter
  
 

Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
Please read the rules - note # 4 about duplicate postings - you will not get an answer quicker doing this but will tend to upset the moderators.
  #3 (permalink)  
Old 08-20-2004
RTM's Avatar
RTM RTM is offline Forum Advisor  
Hog Hunter
  
 

Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
Please post the versions of the other software :

sybase database server
windows
Freetds with ODBC


Also, try this:

Test SQL Server's connections: You can verify that SQL Server is accepting connections using telnet. In a command window, type the following:
telnet <sql server name or ip address> 1433

If you get an error message such as "Could not open a connection to host on port 1433: Connect Failed…" then you should open the SQL Server Enterprise Manager and check the server and port setting. This problem can also be caused by a firewall or if the SQL Server service has been stopped unexpectedly. If you get a blank screen, it means that SQL Server is accepting incoming connections.

And see PHPBuilder.com tutorial on PHP - note the comments about versions and Sybase.
  #4 (permalink)  
Old 08-20-2004
Kelam_Magnus's Avatar
Kelam_Magnus Kelam_Magnus is offline Forum Advisor  
Registered User
  
 

Join Date: Aug 2001
Location: DFW McKinney, TX,
Posts: 1,069
i will delete the other posts as i can or refer to other board admins.

Please read the FAQ again and take note of it.
  #5 (permalink)  
Old 08-23-2004
lealyz lealyz is offline
Registered User
  
 

Join Date: Dec 2001
Location: Lagos, Nigeria
Posts: 41
Quote:
Originally posted by RTM
Please post the versions of the other software :

sybase database server
windows
Freetds with ODBC


Also, try this:

Test SQL Server's connections: You can verify that SQL Server is accepting connections using telnet. In a command window, type the following:
telnet <sql server name or ip address> 1433

If you get an error message such as "Could not open a connection to host on port 1433: Connect Failed…" then you should open the SQL Server Enterprise Manager and check the server and port setting. This problem can also be caused by a firewall or if the SQL Server service has been stopped unexpectedly. If you get a blank screen, it means that SQL Server is accepting incoming connections.

And see PHPBuilder.com tutorial on PHP - note the comments about versions and Sybase.
RTM;

My Freetds version is;
freetds-0.62.3.


Windows is
Windows 2000 Server

Sybase is
Sybase SQL version 10

The unixODBC i installed from ports is unixODBC-2.2.9.
The sybase-ocsd i installed from ports is sybase-ocsd-10.0.4

NB: I am able to connect sucessfully on "telnet ip_address 5000"

lealyz
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:54 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0