note 51420 added to function.odbc-connect
| From: | aurelienmarchand at osu1 dot php dot net | Date: | Wed, 30 Mar 2005 15:54:29 +0000 |
| Subject: | note 51420 added to function.odbc-connect | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-87187@lists.php.net to get a copy of this message | ||
For three days I fought to be able to connect our Linux intranet server to our AS400 database
through ODBC and PHP on Mandrake. I installed everything I thought would work but I still got a:
odbc_connect(): SQL error: Missing server name, port, or database name in call to CC_connect., SQL
state IM002 in SQLConnect
Note that isql was working great but php was failing to connect.
The solution:
I located and found a PHP module called php-unixODBC (to oppose with php-odbc). Once installed (even
though it wasn't for the right version of PHP), I realised it didn't place the file
properly. The ini file was in /etc/php/ instead of /etc/php.d/, so I moved it there and renamed the
old /etc/php.d/36_odbc.ini to /etc/php.d/36_odbc.ini.sav, so that I now had
/etc/php.d/36_unixodbc.ini. I restarted the httpd server and now I was able to access the as400.
If you have questions, email _artaxerxes2_at_iname_dot_com (sans the underscore).
----
Manual Page -- http://www.php.net/manual/en/function.odbc-connect.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+51420
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+51420&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+51420&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+51420&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+51420&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+51420&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+51420&report=yes
Search -- http://master.php.net/manage/user-notes.php