LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-01-2010, 02:34 AM   #1
wakkana12
Member
 
Registered: Dec 2009
Posts: 171

Rep: Reputation: 15
Question MS SQL + ODBC + PHP inquery


hi guys..

so i have this scenario, i installed my slackware 13 box in full installation so it has already mysl + php version 5 + apache.. right now my boss ask me if i can run their projects that has MS SQL + ODBC + PHP version 4.

my question is how can i change my php to version 4? and how can i install ms sql and odbc? is there a slackbuild for php ver 4 and for ms sql and odbc that i could just compile then installpkg it?
 
Old 03-01-2010, 02:51 AM   #2
koloth
Member
 
Registered: Jun 2004
Location: Athens, Greece
Distribution: Slack@Home - RHEL@Work
Posts: 150

Rep: Reputation: 29
Are you sure about MS SQL? It is a Windows-only DB server and i seriously doubt than you can run it even under wine. About PHP, is there a reason for downgrading the version? isn't it backwards compatible?
 
Old 03-01-2010, 02:57 AM   #3
wakkana12
Member
 
Registered: Dec 2009
Posts: 171

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by koloth View Post
Are you sure about MS SQL? It is a Windows-only DB server and i seriously doubt than you can run it even under wine. About PHP, is there a reason for downgrading the version? isn't it backwards compatible?
yes im sure about the mssql part.. i found some thing about the FreeTDS package used to allows your programs to natively talk to Microsoft SQL Server and Sybase databases.

we both came to the same solution i think. im planning to reconfigure the php using an older build..
 
Old 03-01-2010, 03:40 AM   #4
koloth
Member
 
Registered: Jun 2004
Location: Athens, Greece
Distribution: Slack@Home - RHEL@Work
Posts: 150

Rep: Reputation: 29
Just to clarify... you want to connect to an MS SQL server not run it on slackware?
Googling provided this :http://www.easysoft.com/developer/la..._tutorial.html
I haven't tried it but looks valid....
 
Old 03-01-2010, 04:03 AM   #5
wakkana12
Member
 
Registered: Dec 2009
Posts: 171

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by koloth View Post
Just to clarify... you want to connect to an MS SQL server not run it on slackware?
Googling provided this :http://www.easysoft.com/developer/la..._tutorial.html
I haven't tried it but looks valid....
thanks mate.. hmmm.. i think just connecting to the mssql server would be enough. but i may also need to run it in my box..
 
Old 03-01-2010, 09:23 PM   #6
wakkana12
Member
 
Registered: Dec 2009
Posts: 171

Original Poster
Rep: Reputation: 15
well right now i can connect to the mssql server using freetds and as my senior said that it enough to connect to mssql..^^(thankfully i dont need to run mssql server on my box. phew..)

im only problem is the php. i have to downgrade from php 5 to php 4.(something).. i think i have to ./configure another php to to this then add a line in my httpd.conf file to make my apache and php4 to work together.. although i dont know how did slackware installed the apache.

so my question is the above method correct? or do i have to do something else.. does php 4 run on Apache2.2.14?

Last edited by wakkana12; 03-01-2010 at 10:42 PM.
 
Old 03-02-2010, 04:02 AM   #7
koloth
Member
 
Registered: Jun 2004
Location: Athens, Greece
Distribution: Slack@Home - RHEL@Work
Posts: 150

Rep: Reputation: 29
I think the safest way to go would be to first uninstall the slackware version of PHP (5.something) and then compile the latest php 4 from source (./configure, make, make install). "make install" should copy all necessary modules.
If it fails check the "--with-apxs2" parameter.
 
Old 03-02-2010, 07:34 PM   #8
wakkana12
Member
 
Registered: Dec 2009
Posts: 171

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by koloth View Post
I think the safest way to go would be to first uninstall the slackware version of PHP (5.something) and then compile the latest php 4 from source (./configure, make, make install). "make install" should copy all necessary modules.
If it fails check the "--with-apxs2" parameter.
done that mate.. right now im on php4.. but it seems that my php doesnt recognize mysql.. it always says that i should upgrade to another version.
 
Old 03-02-2010, 08:02 PM   #9
wakkana12
Member
 
Registered: Dec 2009
Posts: 171

Original Poster
Rep: Reputation: 15
i have another question.. could i have 2 php eg. php4 and php5? where in i can just switch to php 5 for some certain projects that needs it and when i need to change to php 4 again i dont have to remove php 5 then install php 4?
 
Old 03-02-2010, 11:07 PM   #10
wakkana12
Member
 
Registered: Dec 2009
Posts: 171

Original Poster
Rep: Reputation: 15
ok so i followed the bottom guide in here http://www.linuxquestions.org/questi...ms-sql-350026/ and installed the freetds. every thing went well but when i tried
Code:
/usr/local/freetds/bin/tsql -S 198.168.100.2 -U sa
with the correct ip of the server and the user sa it asked me for a password and i filled it up correctly but the result is not
Code:
1>
instead it was a counting no.. how can i fix this?
 
Old 03-03-2010, 03:15 AM   #11
koloth
Member
 
Registered: Jun 2004
Location: Athens, Greece
Distribution: Slack@Home - RHEL@Work
Posts: 150

Rep: Reputation: 29
About mysql , if you haven't solved it yet, you can try compiling php again using the --with-mysql switch.
As for using both versions of php together, you could try compiling php4 using a different target dir and see how it goes.
According to this http://schlitt.info/opensource/blog/...5_prallel.htmlhttp://schlitt.info/opensource/blog/...5_prallel.html, it is possible.

Last edited by koloth; 03-03-2010 at 03:16 AM. Reason: spelling errors
 
Old 03-03-2010, 05:52 AM   #12
wakkana12
Member
 
Registered: Dec 2009
Posts: 171

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by koloth View Post
About mysql , if you haven't solved it yet, you can try compiling php again using the --with-mysql switch.
As for using both versions of php together, you could try compiling php4 using a different target dir and see how it goes.
According to this http://schlitt.info/opensource/blog/...5_prallel.htmlhttp://schlitt.info/opensource/blog/...5_prallel.html, it is possible.
got both working for a while now.. the only problem in mysql is that i have a password that was hashed by a newer version thats why the older version of php doesnt recognize it.. thanks mate for your feedback..

the only problem now is that php returns an error in the line where i tried to connect to the mssqlserver using odbc_connect();
 
Old 03-03-2010, 07:12 AM   #13
Mark Pettit
Member
 
Registered: Dec 2008
Location: Cape Town, South Africa
Distribution: Slackware 15.0
Posts: 619

Rep: Reputation: 299Reputation: 299Reputation: 299
Before trying to resolve odbc issues, first make sure that the tsql is working.
In your example you used "/usr/local/freetds/bin/tsql -S 198.168.100.2 -U sa",
which doesn't look right to me. If you use the -S option, then you have to
have that server name configured in the freetds.conf file - and i seriously
doubt that you named the server "196.168.100.2" !
To use the IP address, you need to use the -h AND the -p (host and port) options.
Personally I reckon it's better to use the freetds.conf file, where you could have
and entry like this :

[FredsDatabase]
host = 169.168.100.2
port = 1433
tds version = 7.0

I use freetds a lot, both from Linux and Solaris against many MS-SQL servers and
it works really well. I don't use odbc and I certainly don't use PHP either - but I
don't think that's where your problem lies (yet).
 
Old 03-04-2010, 04:41 PM   #14
wakkana12
Member
 
Registered: Dec 2009
Posts: 171

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Mark Pettit View Post
Before trying to resolve odbc issues, first make sure that the tsql is working.
In your example you used "/usr/local/freetds/bin/tsql -S 198.168.100.2 -U sa",
which doesn't look right to me. If you use the -S option, then you have to
have that server name configured in the freetds.conf file - and i seriously
doubt that you named the server "196.168.100.2" !
To use the IP address, you need to use the -h AND the -p (host and port) options.
Personally I reckon it's better to use the freetds.conf file, where you could have
and entry like this :

[FredsDatabase]
host = 169.168.100.2
port = 1433
tds version = 7.0

I use freetds a lot, both from Linux and Solaris against many MS-SQL servers and
it works really well. I don't use odbc and I certainly don't use PHP either - but I
don't think that's where your problem lies (yet).
thanks for the help mate..^^ but my tsql works fine as i have said.. i got the problem isolated and just yesterday figured out what was wrong.. now i got everything perfectly working..
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
odbc with ms sql server mierdatuti Linux - Software 3 06-25-2011 07:26 AM
php excel odbc issue C-RAF. Programming 2 06-03-2006 04:54 PM
Fedora 4 - ODBC with PHP b_whelan Linux - Software 0 12-09-2005 05:54 AM
Using ODBC to MS SQL ejennings_98 Linux - Software 7 08-05-2005 12:10 PM
ODBC sql.h question javakid Programming 0 11-16-2004 08:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration