Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

php

pdo

odbc

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?

like image 612
MiniGunnR Avatar asked Jan 25 '17 09:01

MiniGunnR


People also ask

How do I install PDO drivers?

Pdo ( Portable Data Object ) needs to be installed if it is not done before. For windows platform go to control panel > Add remove program ( or Programs and features ) > Select your PHP installation and click Change. If you are installing PHP fresh then in the setup wizard you can select PDO from Extensions link.

How do I know if PHP PDO is installed?

The -i is used to display the output of phpinfo(). The |grep will filter the list to the ones containing PDO.

What is PHP ODBC?

PHP is one of the most common open-source programming languages for web applications and websites development. ODBC is an API that allows you to connect to a data source, such as PostgreSQL, Oracle, MySQL, MongoDB or SQL Server, using standard PHP functions and Devart ODBC Drivers.

What is a PHP driver?

The Microsoft Drivers for PHP for SQL Server enable integration with SQL Server for PHP applications. The drivers are PHP extensions that allow the reading and writing of SQL Server data from within PHP scripts.


1 Answers

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.

like image 65
E_p Avatar answered Oct 11 '22 23:10

E_p