Edit PHP configure command

(Mike) #1

This is my scenario: When running phpinfo(); on any of my ibays, in the section “configure command” i see an option there i have to change:
In fact, I’ve successfully installed and configured on the system freedts and unixodbc for connect to a MSSQL DSN.

[root@nethserver ~]# isql -v <DSN> <user> <pwd>
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |

So it seems working, but i’d have to connect to this DSN by a PHP web app, and can’t do this with --whithout-unixODBC in PHP config.
Can someone help me?


(Giacomo Sanchietti) #2

I can’t understand what you’re tying to achieve.
Please do not post the solution, but the problem :wink:

What do you want to do?
Access an ODBC resource from a PHP script?

(Mike) #3

Correct Giacomo.
When I try to access an ODBC resource from a PHP script i get:

Fatal error: Call to undefined function odbc_exec()

Also, function_exists(‘odbc_exec’); and function_exists(‘odbc_connect’); returns both false.

(Giacomo Sanchietti) #4

Just install the relevant rpm and restart Apache:

yum install php-odbc
service httpd restart

(Mike) #5

I had already installed.

yum remove php-odbc
service httpd restart
yum install php-odbc
service httpd restart

does the trick and worked for me.
Thank you Giacomo! :wink: