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

前端 未结 4 880
伪装坚强ぢ
伪装坚强ぢ 2021-01-13 09:46

I am getting the following exception when i try to use the fetchall method of the Zend_Db_Table_Abstract class...

An error occurred4545
EXCEPTION_OTHER
Excep         


        
相关标签:
4条回答
  • 2021-01-13 10:25

    First of all, you cannot have both :

    extension=pdo.so
    extension=pdo_mysql.so
    

    Which are for Linux, and :

    extension=php_pdo.dll 
    extension=php_pdo_mssql.dll 
    

    Which are for windows : you've got to choose, depending on the system you are using.

    As you are on windows, you should use the .dll version.


    But note that you used :

    extension=php_pdo_mssql.dll 
    

    i.e. you loaded the pdo_mssql extension -- which is for Microsoft SQL Server, and not MySQL.

    Instead, you should load the extension for MySQL :

    extension=php_pdo_mysql.dll 
    

    After correcting that, restart Apache ; and things should get better.


    If things don't get better, you should check the output of phpinfo() :

    • At the beginning of phpinfo()'s output, it indicates which php.ini file is loaded ; make sure you modified the right one.
    • Check, lower in the file, if there is a section about pdo_mysql
      • If not, check Apache's error_log, just in case ;-)
    0 讨论(0)
  • 2021-01-13 10:30

    Today I have moved one website from our testing server to the client server and getting such kind of the error that The PDO extension is required for this adapter but the extension is not loaded. I was thinking that there must be pdo.so php extension which is not installed on the server. After recogniging the problem, I was looking for the php.ini file to check the extension but due to the shared hosting they did not provide me the ini file.

    Here in this post I am trying to describe how to solve the such kind of the problem it is very easy and you can solve the problem by using the steps given below:

    If you want to know more regarding the PDO look at http://php.net/manual/en/ref.pdo-mysql.php

    If you have access of the php.ini file then check

    ;extension=pdo_mysql.so
    

    Just you need to uncomment the line to activate so it looks like as

    extension=pdo_mysql.so
    

    Save the file and restart the server.

    If you have no access of the php.ini file, follow the following steps

    Step 1. Please check your Magento installation directory there must me a file named as php.ini.sample.

    Step 2. Now rename the file from php.ini.sample to php.ini

    Step 3. Put the below code into it

    extension = pdo.so
    extension = pdo_sqlite.so
    extension = sqlite.so
    extension = pdo_mysql.so
    

    Step 4. Now refresh your browser cache and the problem has been solved.

    0 讨论(0)
  • 2021-01-13 10:41

    Mabe swich backed from PDO to Mysqli helps, they're swichable in ZF (i did so).

    0 讨论(0)
  • 2021-01-13 10:50

    If your on godaddy hosting account and you can't do anything because of the restriction to main configuration files of the server and you cant restart apache. You can bypass this problem by changing the php version from "Select PHP Version" this way you will restart settings. In my case I tryied to edit php.ini than php5.ini also added .user.ini file and in result of that i got this error: PDO extension is required for this adapter but the extension is not loaded Now my problem is solved, this solution can work on other hostings not only godaddy if you are not a system administrator!!!

    0 讨论(0)
提交回复
热议问题