jlr2k8 Posted April 1, 2007 Share Posted April 1, 2007 Previously, I had my server set up with PHP 4.4.4 and PostgreSQL 8.1, and I had no problems at all. I got a new server today, and I installed the latest PostgreSQL (8.2) and PHP 5.2.1. For some reason though, I keep getting errors... like PHP doesn't recognize the Postgres database. I get errors like these: Warning: odbc_connect() [function.odbc-connect]: SQL error: [Microsoft][ODBC Driver Manager] The server appears to be not available., SQL state 08S01 in SQLConnect in D:\...index.php on line 32 Warning: odbc_exec(): supplied argument is not a valid ODBC-Link resource in D:\...index.php on line 23 Warning: odbc_fetch_row(): supplied argument is not a valid ODBC result resource in D:\...index.php on line 24 Quote Link to comment Share on other sites More sharing options...
trq Posted April 1, 2007 Share Posted April 1, 2007 For starters, why are you using ODBC when there is a perfectly good postgres extension? Secondly... were going to need more info. What OS are you using? And did you compile PHP yourself? Quote Link to comment Share on other sites More sharing options...
jlr2k8 Posted April 1, 2007 Author Share Posted April 1, 2007 Thx for the fast reply. Hmm, I'm not very familiar with DB connections I guess. PHP 5.1.2 w/ PostgreSQL Win2k Adv Server (IIS 5.0) Yeah I compiled PHP myself, since the installer always fails. Quote Link to comment Share on other sites More sharing options...
trq Posted April 1, 2007 Share Posted April 1, 2007 Yeah I compiled PHP myself In windows? What does your .configure line look like? Did you compile with ODBC support? Quote Link to comment Share on other sites More sharing options...
jlr2k8 Posted April 1, 2007 Author Share Posted April 1, 2007 What .configure line? Quote Link to comment Share on other sites More sharing options...
trq Posted April 1, 2007 Share Posted April 1, 2007 Create a test page.... <?php phpinfo(); ?> At the top somewhere ought to be a ./configure line. If you had compiled PHP you would know what it is, are you sure you know what compiling is? Quote Link to comment Share on other sites More sharing options...
jlr2k8 Posted April 2, 2007 Author Share Posted April 2, 2007 Gotcha. I thought you were referring to the ini file. Maybe I don't know what compiling is. All I usually do is download the Windows ZIP file, and extract it to c:\php, then edit the php.ini file. Do you mean compile from source? Quote Link to comment Share on other sites More sharing options...
trq Posted April 2, 2007 Share Posted April 2, 2007 Do you mean compile from source? Yes. I'm sorry, I'm not real familiar with the windows installs. I'm pretty sure you just need to uncomment the odbc line in your php.ini then restart Apache. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.