Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PDO drivers no value in Windows

Tags:

php

windows

The php_pdo_mysql.dll can't be enabled in machine. I have set extension=php_pdo.dll and extension=php_pdo_mysql.dll enabled in php.ini, but when I checked phpinfo(), the item PDO drivers is no value.

and also I can't find the mysql infos in phpinfo() but I have set extension=php_mysql.dll enabled.

What's wrong ?

like image 345
Hardy Lim Avatar asked Aug 17 '11 00:08

Hardy Lim


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.

What are PDO drivers?

PDO_MYSQL is a driver that implements the PHP Data Objects (PDO) interface to enable access from PHP to MySQL databases. PDO_MYSQL uses emulated prepares by default.

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 are PHP drivers?

In this article The drivers are PHP extensions that allow the reading and writing of SQL Server data from within PHP scripts. The drivers provide interfaces for accessing data in Azure SQL Database and in all editions of SQL Server 2005 and later (including Express Editions).


1 Answers

I had this same problem when I upgraded to PHP 5.4. I had

extension_dir = "ext" 

in php.ini and php -m was starting fine and reporting that it loaded pdo_mysql, but when I ran phpinfo.php through apache, the driver was missing.

I fixed it by changing the extension_dir to an absolute path. I'm guessing it got confused when running through Apache and made it relative to something else.

; Directory in which the loadable extensions (modules) reside. ; http://php.net/extension-dir ; extension_dir = "./" ; On windows: extension_dir = "D:/php-5.4.11-Win32-VC9-x86/ext" 
like image 173
takteek Avatar answered Sep 20 '22 00:09

takteek