PDO drivers no value in Windows

后端 未结 16 1405
盖世英雄少女心
盖世英雄少女心 2020-11-29 07:31

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.in

相关标签:
16条回答
  • 2020-11-29 07:46

    I had the same issue, and was stumped until I read the following:

    http://www.artfulsoftware.com/php_mysql_win.html

    I am running PHP 5.2 with Apache 2.2. The fix for me was to copy the libmysql.dll file into my Apache bin directory.

    I would recommend the following course of action to anyone having this issue: 1) check to make sure that loaded configuration file is where you think it is (i.e., that Apache is not using some default php.ini) - phpinfo() will provide the answer on this 2) check to make sure that all desired extensions are located in the php\ext folder and are included in the php.ini file (most popular extensions simply need to be uncommented) 3) Try to load pdo_sqllite. If this shows up in phpinfo() after restarting Apache, you've narrowed the problem to the inability of Apache to load the necessary mysql extensions. 4) Follow in instructions in the link above.

    0 讨论(0)
  • 2020-11-29 07:49

    I was having this problem on Windows using IIS. My php.ini contained the following sections:

    [PHP_PDO_MYSQL]
    extension=php_pdo_mysql.dll
    [PHP_PDO]
    extension=php_pdo.dll
    

    I simply took the [PHP_PDO_MYSQL] and [PHP_PDO] sections, and swapped their positions, so that [PHP_PDO] came first. I guess declaration order is important!

    0 讨论(0)
  • 2020-11-29 07:49

    check that pdo*.dll files are in appropriate locations in OS directory, check references for these files are enabled in php.ini, check your dbconnection string is correct, restart apache

    0 讨论(0)
  • 2020-11-29 07:51

    Mihai's comment in 2012 says: "Try php -m in console, it will show startup errors of PHP." This suggestion proved to be most helpful. If there are any errors in the php.ini file, Windows PHP manager (IIS 8) is not very clear about what's wrong with php.ini.

    Go to the Command Prompt and type php -m at the prompt. A pop-up message (alert) will let you know about any errors AND it gives line numbers for those problems. In most cases, my only issue was that I had uncommented (removed the semi-colon) on a few php.ini lines where I should NOT have done so.

    Another helpful tip for me was to put in the full path for the extensions folder, (see comment above by Jeremy Prine) which helped with the "missing dll" messages started popping up in the alert boxes.

    0 讨论(0)
  • 2020-11-29 07:57

    In PHP 7.1 x64 on windows with apache 2.4 x64:

    extension_dir = "ext" doesn't work for me,

    absolute path: extension_dir = "C:\DEV\PHP71\ext\" worked well

    0 讨论(0)
  • 2020-11-29 07:58

    Try php -m in console, it will show startup errors of PHP.

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