12

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?

hakre
  • 193,403
  • 52
  • 435
  • 836
MiniGunnR
  • 5,590
  • 8
  • 42
  • 66
  • Have a look at [this answer](http://stackoverflow.com/questions/41910255/plesk-12-on-centos-6-not-working-pdo-odbc-dblib-drivers ). I think it should solve your issue. – Jerry U May 14 '17 at 13:42
  • It solved my problem: yum install php-pdo – Albeis May 18 '17 at 10:14
  • What you link as a tutorial relates to the PHP source distribution, you need to obtain the sources first if you like to compile the extension your own (configure is a step prior compilation and part of a common build flow). – hakre May 19 '17 at 09:23

1 Answers1

8

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.

E_p
  • 3,136
  • 16
  • 28