MySQL PDO is not enabled in phpinfo ()

I am trying to setup a local PHP development envrironment but am having trouble getting mySQL enabled for PDO and am fairly new to this type of setup…so Im not sure what I could be missing.

I have uncommented:

extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_pdo.dll
extension=php_pdo_mysql.dll

and set the extension_dir to:

extension_dir = "C:PHPext"

Also, I have copied the libmysql.dll file to the Bin dir in Apache and I am sure I am checking the right php.ini file.

When I open phpinfo() I get the following:

**mysql**
Active Persistent Links  0
Active Links  0
Client API version  5.0.27  

Directive Local Value Master Value
mysql.allow_persistent On On
mysql.connect_timeout 60 60
mysql.default_host no value no value
mysql.default_password no value no value
mysql.default_port no value no value
mysql.default_socket no value no value
mysql.default_user no value no value
mysql.max_links Unlimited Unlimited
mysql.max_persistent Unlimited Unlimited
mysql.trace_mode Off Off 

**mysqli**
Client API library version  5.0.27
Client API header version  5.0.22
MYSQLI_SOCKET  /tmp/mysql.sock  

Directive Local Value Master Value
mysqli.default_host no value no value
mysqli.default_port 3306 3306
mysqli.default_pw no value no value
mysqli.default_socket no value no value
mysqli.default_user no value no value
mysqli.max_links Unlimited Unlimited
mysqli.reconnect Off Off 

**PDO**
PDO drivers  no value

Running php.exe -m
on the command line gives me the following error:

PHP Warning: PHP Startup: Unable to load dynamic library 'C:PHPextphp_mysql.dll' - the specified module could not be found.

I get the above error for:

php_mysql.dll
php_pdo_mysql.dll
php_pdo.dll

If I enable sqlite, that shows up fine in the phpinfo() listing.

Whe I go to the page that is supposed to be using the mysql connection I get the following error:

Fatal error:Uncaught exception ‘PDOException’ with message ‘could not find driver’ in C:Inetpubwwwroottestconnection.php:11 Stack trace: #0 C:Inetpubwwwroottestconnection.php(11): PDO->__construct(‘mysql:host=xxx….’, ‘loginname’, ‘password’) #1 C:Inetpubwwwroottestpagename.php(18): include(‘C:Inetpubwwwr…’) #2 {main} thrown in C:Inetpubwwwroottestconnection.php on line 11

Using EasyPHP for development. Didn’t have a problem until I had to use mySQL

Using PHP from Apache und the command line are two different things:

You put libmysql into apaches bin-folder. When you start php from the command line, libmysql must be also accessible from there, eg. when it is in PATH.

Hello, buddy!稿源:Hello, buddy! (源链) | 关于 | 阅读提示

本站遵循[CC BY-NC-SA 4.0]。如您有版权、意见投诉等问题,请通过eMail联系我们处理。
酷辣虫 » 后端存储 » MySQL PDO is not enabled in phpinfo ()

喜欢 (0)or分享给?

专业 x 专注 x 聚合 x 分享 CC BY-NC-SA 4.0

使用声明 | 英豪名录