RE: [PHP-DB] Env Var ???? (With iODBC vs MS-SQL instead of DB2)

From: Date: Fri, 28 Sep 2001 19:43:31 +0000
Subject: RE: [PHP-DB] Env Var ???? (With iODBC vs MS-SQL instead of DB2)
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-12830@lists.php.net to get a copy of this message
Scott, You were probably using the "Unified ODBC" functions. These are the ODBC function used without an ODBC Driver or Driver Manager. True ODBC means that a Driver Manager handles registering/calling/administrating drivers. For ease of use, the PHP developers took some databases that had almost identical function syntax and let people use odbc_x to cover them... but that does NOT use the ODBC API nor an ODBC driver. To enable iODBC (the Driver Manager) you simply compile --with-iodbc=/path/to/odbcsdk LD_LIBRARY_PATH is important here too (or your system's equivalent). Export it before you compile and set it before you start apache later. Here is a condensed instruction set from the HOWTO at www.iodbc.org. This assumes you are using /usr/local/src as a location to unstuff the iODBC, PHP, and Apache source. I recommend checking out the HOWTO directly, though it may be inaccessible for the next 24 hours since we moved to a new IP address. export LD_LIBRARY_PATH=/usr/local/src/odbcsdk/lib cd apache_1.3.x ./configure --prefix=/www cd ../php-4.x.x ./configure –with-iodbc=/usr/local/src/odbcsdk --with-apache=../apache_1.3.x --enable-track-vars make make install cd ../apache_1.3.x ./configure –prefix=/www --activate-module=src/modules/php4/libphp4.a make make install cd ../php-4.x.x cp php.ini-dist /usr/local/lib/php.ini edit your httpd.conf and uncomment (remove the "#") from these lines: AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps /www/bin/apachetl start (or restart) Hope this helps! Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access & Data Integration Technology Providers > -----Original Message----- > From: Scott Fletcher [mailto:scott@abcoa.com] > Sent: Friday, September 28, 2001 3:33 PM > To: php-db@lists.php.net > Subject: Re: [PHP-DB] Env Var ???? (With iODBC vs MS-SQL instead of DB2) > > > > Ensure (with a phpinfo(); ) that iODBC is actually compiled in. > > Also, finding your MSSQL is simply a matter of finding the > proper DSN's in > > the odbc.ini. > > The DSN in odbc.ini is working properly because when I did the odbctest > through the AIX terminal, it worked beautifully. So, I have no doubt the > DSN is a problem through the website's PHP. The Env Var seem to work > properly since it is a similar replica of the one from the Linux machine. > You mentioned about the "phpinfo()" so I checked it out. I have no idea > of what it look like if it have iodbc included. So, I compare the > "phpinfo()" from this AIX machine to the one from Linux. The one on linux > showed the "odbc" section with detail info and it include the > "iodbc" in the > "ODBC library". So, I checked it out with the AIX one, it only showed the > "db2". So, you may be on the right track. I'm going to have to recompile > it again. > > How do I recompile PHP to recognize the iODBC? It doesn't work > this time > when I did that. I'll try removing hte PHP directory and start a > fresh copy > to see if that will work. > (any advice is appreciated) > > ------------------------------------------------------------------ > ---------- > --------------------------- > > What do you mean that when using PHP it 'points' to DB2? How are you > > determining this and are you getting some error message we can see? > > --clip begin-- > Warning: SQL error: [IBM][CLI Driver] SQL1001N "LIVE_DP_KB_1" is > not a valid > database name. SQLSTATE=2E000 , SQL state S1501 in SQLConnect in > /home/website/test/www/index.php on line 38 > --clip end-- > > I looked it up on the website for specific information about > the SQL Error > Code to find out what it meant. On the website, it said DB2. It > also said > that "SQL1001N" refer to the word "Live_DP_KB_1" as more than 1 to 7 > characters. That was odd, so I renamed it to "DP_KB_1" which fall in > between 1 to 7 characters. This is where I get another error message --> > > --clip begin-- > Warning: SQL error: [IBM][CLI Driver] SQL1013N The database alias name or > database name "DP_KB_1" could not be found. SQLSTATE=42705 , SQL > state 08001 > in SQLConnect in /home/website/test/www/index.php on line 36 > --clip end-- > > Since I have DB2 on the same machine as the iODBC Driver manager is on. > So, I knew the PHP is pointing to DB2. So, I type in the database name, > username and password in the script that is part of the database > in DB2 and > I got the database result from it. So, PHP was really communicating with > DB2 on this machine. > > Thanks, > Scott > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.db (#12830) next »