How do I install PHP PDO ODBC drivers on CentOS 7?

10,207

Looks like php_odbc is one of CentOS 7 packages. See http://mirror.centos.org/centos/7/os/x86_64/Packages/ it is a very long list.

So yum -y install php_odbc should work. Just don't forget to restart your web-server if required.

You would run ./configure ... if you were compiling PHP from source. It will not work in your case.

Share:
10,207
MiniGunnR
Author by

MiniGunnR

Updated on June 19, 2022

Comments

  • MiniGunnR
    MiniGunnR almost 2 years

    I already have PHP 5.4 installed in a CentOS 7 VPS. I am trying now to access a legacy database in .mdb format with a PHP script.

    However, my phpinfo() page says that only mysql and sqlite PDO drivers are enabled. No driver named ODBC is enabled.

    Which is why I have tried to follow this tutorial to get that to work. But it doesn't work. bash: ./configure: No such file or directory.

    I don't know from which folder I have to run the commands listed there. Is there a command which will allow me to install the PDO ODBC drivers from the system e.g. yum -y install php_odbc which would be easier for me to work with? If not, what am I doing wrong?

  • Keith John Hutchison
    Keith John Hutchison over 5 years
    yum -y install php-odbc #worked on our device. php_odbc failed.