Pdo Drivers No Value in Windows

PDO drivers no value in Windows while migrating PHP 7 from 5.6 in xampp

What I figure out about your problem is, with the modifications you made, the PHP configuration does not change. Maybe the php.ini used is not the same? With the phpinfo() function, you should have the complete path of the php.ini file used. Try this piece of code in order to figure out this:

<?php

phpinfo(INFO_GENERAL);

The Loaded Configuration File is what you are looking for in order to do so.

How do I install PDO drivers for PHP on Windows?

The problem was the extension_dir directive did not work as a relative path. Changing from extension_dir="ext" to extension_dir="c:/phpinstall_path/ext" fixed the problem.

PHP7 and pdo_mysql

For some reason, not sure why, Windows needs an absolute path to the extension dir. So instead of

extension_dir = "ext"

in php.ini, I put

extension_dir = "C:/xampp/php/ext"

and then restarted apache. Everything works again.

Maybe someone can elaborate on this issue?

Why are PHP 7 PDO drivers missing?

When creating the connection, your DSN has localhost as the database type...

$dbh = new PDO('localhost:host=$servername;dbname=test', $username, $password);

from the manual

$dbh = new PDO('mysql:host=localhost;dbname=test', $user, $pass);

Also as you use single quotes, the servername will not be replaced, so use

$dbh = new PDO("mysql:host=$servername;dbname=test", $username, 

Impossible to load pdo driver on Windows Server 2016

Solved !
Guys are going to laugh at me. I was looking for problem everywhere but in fact the problem was so simple that I couldn't see it. In httpd.conf, when adding PHPIniDir "c:/php" at the end of the file, I actually added PHPIniDir "c/php". What a shame ! But finally catched it. Thank you for your help.



Related Topics



Leave a reply



Submit