Mubi Mubi - 3 months ago 14
PHP Question

PHP Configuration : PDO extension is enabled but not loading

I'm using Windows 7, wamp server version 2.2, PHP version 5.2.9. When I try to run my magento websites on a localhost it gives me the following error:

"The PDO extension is required for this adapter but the extension is not loaded"

I have double check that PDO extensions are enabled in the php.ini file.

;extension=php_bz2.dll
extension=php_curl.dll
;extension=php_dba.dll
;extension=php_dbase.dll
;extension=php_exif.dll
;extension=php_fdf.dll
extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_ifx.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
extension=php_mbstring.dll
extension=php_mcrypt.dll
;extension=php_mhash.dll
;extension=php_mime_magic.dll
;extension=php_ming.dll
;extension=php_msql.dll
;extension=php_mssql.dll
extension=php_mysql.dll
extension=php_mysqli.dll
;extension=php_oci8.dll
;extension=php_openssl.dll
extension=php_pdo.dll
;extension=php_pdo_firebird.dll
;extension=php_pdo_mssql.dll
extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_oci8.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
;extension=php_pspell.dll
;extension=php_shmop.dll
;extension=php_snmp.dll
extension=php_soap.dll
;extension=php_sockets.dll
;extension=php_sqlite.dll
;extension=php_sybase_ct.dll
;extension=php_tidy.dll
;extension=php_xmlrpc.dll
;extension=php_xsl.dll
;extension=php_zip.dll


Also the phpinfo loading the right php.ini file. It was working earlier but suddenly start to give the error. I also checked the Apche error log but didn't find any clue.

Please suggest.

Answer
  • First move the extension directory to \Windows\System32\inetsrv{php}\extension
  • Change the path from php.ini file

I think you have a security problem to loading .dll! Try this and let me know the result.


To find out which php.ini file has been loaded, try the following ( run in commandline and webserver to make sure which edition loading different environment).

Checking the php.ini file path :

<?php
    $path = php_ini_loaded_file();
    echo 'The loaded file path is :' . $path;
?>
Comments