Re: [PHP-DB] unixODBC + PHP 4.4.4
- Original Message - From: "Drewfus" <[EMAIL PROTECTED]> To: Sent: Tuesday, February 13, 2007 5:08 PM Subject: [PHP-DB] unixODBC + PHP 4.4.4 > Hi, > > I've installed unixODBC with the EasySoft ODBC Driver and have connectivity > working to my MS-SQL Server fine. I can login with the iSQL tool and > perform queries without issue - I then moved onto recompiling PHP/Apache > with unixODBC support, but when testing it I see: > > *Fatal error*: Call to undefined function: odbc_connect() > > The PHP script is pretty basic: i do believe the odbc on your comp are not configure yet. another problem may cause from ODBC library (php) for oracle.. u can connect without using odbc (since oracle have own library) i suggest you search for the library (odbc) if you don't use oracle (i read below) or perhaps u search for oracle libary instead odbc.. > putenv("ODBCINI=/etc/odbc.ini"); > putenv("ODBCINSTINI=/etc/odbcinst.ini"); > putenv("LD_LIBRARY_PATH=/usr/local/easysoft/unixODBC/lib"); i don't think above is necessary.. since the default PHP must already connect to the odbc.. > > $Conn= odbc_connect ("db","user","pass") > or die ("Can't open ODBC-DSN"); > $Rec = odbc_exec ( $Conn, "select * from viewDB") > or die ("Can't execute QUERY"); > > echo "Records returnd : ".odbc_num_rows($Rec)."\n"; > echo "\n"; > ?> > > I verified that during the configure, With unixODBC Support was showing up > as Yes, also there were no compile errors whatsoever. When I check > phpinfo() - I see the following configure command: > > './configure' '--with-png-dir=/usr/local/lib' > '--with-zlib-dir=/usr/local/lib' '--with-gd' > '--with-apache=../apache_1.3.27' > '--with-unixODBC=shared,/usr/local/easysoft/unixODBC' '--without-mysql' > '--with-oracle=/u01/OraHome1' '--with-oci8=/u01/OraHome1' > > The build date is updated with today's date, and the Oracle connectivity > still works - any ideas on why odbc_connect would be an undefined function > with that configure command? > > Thanks, > -D > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] unixODBC + PHP 4.4.4
'./configure' '--with-png-dir=/usr/local/lib' '--with-zlib-dir=/usr/local/lib' '--with-gd' '--with-apache=../apache_1.3.27' '--with-unixODBC=shared,/usr/local/easysoft/unixODBC' '--without-mysql' '--with-oracle=/u01/OraHome1' '--with-oci8=/u01/OraHome1' The build date is updated with today's date, and the Oracle connectivity still works - any ideas on why odbc_connect would be an undefined function with that configure command? When you compile with the 'shared' option, you need to make sure either the php.ini loads the .so file or you do using http://www.php.net/dl Is either happening? Check with a phpinfo page. -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] unixODBC
Martin, I did not see your last email, but if you are having problems with unixodbc you may wish to try iODBC - http://www.iodbc.org Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access & Virtuoso Universal Server -Original Message- From: Marten Lehmann [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 17, 2002 3:53 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] unixODBC Hello, isn't anybody using unixODBC with php out there? I still hope to get help to solve my unixODBC problem as described in my last mail. Regards Marten -- Variomedia IT-Service GmbH | Benzstrasse 22 | 14482 Potsdam http://www.variomedia.de | Hotline: 0800-5588550 | Fax: 0331-7404043 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] unixODBC Question/Problem
Eric Liedtke wrote: > I am running PHP/Apache. I have installed unixODBC and inlinks tds > driver. I can succesfully connect and query an MS SQL db from the isql > command line testing tool provided with unixODBC. I recompiled php > with unixODBC support and it compiled and installed without a problem. > So it was onto writing the php. I can connect query and close the DB > fine. However my query results always have 1 of 2 things. Either they > are empty or the contain gibberish. At this point I don't know where > to start troubleshooting the breakdown. Any help would be greatly > appreciated. I don't know what info anyone might need from me, but > will be more than happy to provide it. Thanks in advance. > Eric Liedtke > > p.s. on a google search I found only one other mention of this in a > dbforum website. sadly there were no replies to the posting there. > > I just wanted to drop a note out that I got my problem fixed. This is what I did to fix it... putenv("ODBCINI=/usr/local/etc/odbc.ini"); putenv("ODBCINSTINI=/usr/local/etc/odbcinst.ini"); putenv("LD_LIBRARY_PATH=/usr/local/freetds/lib"); at the begining of the php script. Specifically the LD_LIBRARY_PATH did it. Without it I get garbage. I have no idea why and would be curious if there is any other solution, but regardless I just thought I'd point this out. This actually came out of the example script in the iODBC php howto page on iodbc.org. Just and fyi Eric Liedtke -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]