Monday, 15 August 2011

php - ODBC Module in MAMP: Call to undefined function odbc_connect() -



php - ODBC Module in MAMP: Call to undefined function odbc_connect() -

i spent day trying install odbc module php installation in mamp. after searching hours, trying, failing , trying again, managed compile pdo_odbc.so file , mamp load nice (i utilize this guide instead of using pecl compiled myself this instructions)

as can see in image of phpinfo(), mamp recognizes unixodbc driver.

but when utilize odbc_connect() in code, error:

fatal error: phone call undefined function odbc_connect() in ...

it seems that, despide mamp recognizes unixodbc driver, web app doesn't it. need add together configuration in php.ini file?

i don't know if has installed unixodbc homebrew , installed in /usr/local/cellar/unixodbc, in ./configure command (before compile odbc module) used parameter --with-pdo-odbc=unixodbc looks in /usr/local folder. don't know if can cause of error.

thanks

the "pdo_odbc" module work objects:

$dbh= new pdo('odbc:sourcename', 'username', 'password');

i compiled php "shared" alternative create odbc.so module (adding odbc mamp)

./configure --with-unixodbc=shared create cp modules/odbc.so /applications/mamp/bin/php/php5.5.10/lib/php/extensions/no-debug-non-zts-20121212/ echo "extension=odbc.so" >> /applications/mamp/bin/php/php5.5.10/conf/php.ini

php osx odbc mamp

No comments:

Post a Comment