PDO drivers no value in Windows

Source: Internet
Author: User
Tags php programming

Learning PHP Programming Encounters

Uncaught exception ' pdoexception ' with a message ' could not find driver '  

Or

Undefined class constant ' Mysql_attr_init_command '

The whole two questions, the Internet to find a lot of information, a lot of this solution

Configure the php.ini file to add Extension=php_pdo_mysql.dll so that the Pdomysql extension library is turned on

But I did not solve the problem, the problem is still the same, and later found the problem in StackOverflow

Specific links http://stackoverflow.com/questions/7086859/pdo-drivers-no-value-in-windows

The problem is.

Extension_dir = "ext"
You can change it to an absolute path.
; 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"
Reason

In PHP.ini and php -m is 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 absolute path. I ' m guessing it got confused when running through Apache and made it relative to something else.

I fixed it by changing the absolute path of the extension_dir. I guess it confuses the runtime through Apache and relative to something else.

Reprint: http://blog.csdn.net/bao0682/article/details/46827111

PDO drivers no value in Windows

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.