1

I'm using WinNMP for my local dev environment. I installed and configured everything successfully last week, and everything was running well. Unfortunately, I needed to reset my windows installation to clear up some disk I/O issues. After the reset, I rebuilt the dev environment (MySQL, WinNMP, VSCode, etc.) and restored all the project files and settings (nginx server blocks, databases, etc.) Now, my Craft site is giving me an internal server error..."unsupported DB driver", which is set to 'mysql' in .env.

I've verified that my MySQL install is working. I'm able to connect and query successfully with a simple php script using the same credentials. My PHP requirements check shows no concerns. What else may be the issue? i wasn't sure if I need to do any Composer installs or checks after restoring the project files.

Here's the full stack trace...

2019-05-05 15:34:17 [-][-][-][error][craft\base\ApplicationTrait::getIsDbConnectionValid] There was a problem connecting to the database: Unsupported DB driver value: 
2019-05-05 15:34:17 [-][-][-][error][yii\web\HttpException:503] craft\web\ServiceUnavailableHttpException in C:\WinNMP\WWW\merkhaus\vendor\craftcms\cms\src\web\Application.php:533
Stack trace:
#0 C:\WinNMP\WWW\merkhaus\vendor\craftcms\cms\src\web\Application.php(187): craft\web\Application->_processInstallRequest(Object(craft\web\Request))
#1 C:\WinNMP\WWW\merkhaus\vendor\yiisoft\yii2\base\Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#2 C:\WinNMP\WWW\merkhaus\web\index.php(21): yii\base\Application->run()
#3 {main}
2019-05-05 15:34:17 [-][-][-][profile begin][craft\web\View::renderTemplate] 503
2019-05-05 15:34:17 [-][-][-][profile begin][craft\web\twig\Template::display] 503
2019-05-05 15:34:17 [-][-][-][profile begin][craft\web\twig\Template::display] _layouts/message
2019-05-05 15:34:17 [-][-][-][profile begin][craft\web\twig\Template::display] _layouts/base
2019-05-05 15:34:17 [-][-][-][info][application] $_GET = [
    'p' => 'admin/install'
]

$_POST = []

$_FILES = []

$_COOKIE = []

$_SERVER = [
    'ALLUSERSPROFILE' => 'C:\\ProgramData'
    'APPDATA' => 'C:\\Users\\jimme\\AppData\\Roaming'
    'CommonProgramFiles' => 'C:\\Program Files\\Common Files'
    'CommonProgramFiles(x86)' => 'C:\\Program Files (x86)\\Common Files'
    'CommonProgramW6432' => 'C:\\Program Files\\Common Files'
    'COMPOSER_CACHE_DIR' => 'c:\\winnmp\\bin\\composer'
    'COMPOSER_HOME' => 'c:\\winnmp\\bin\\composer'
    'COMPUTERNAME' => 'DESKTOP-R7F7LDM'
    'ComSpec' => 'C:\\WINDOWS\\system32\\cmd.exe'
    'DriverData' => 'C:\\Windows\\System32\\Drivers\\DriverData'
    'FPS_BROWSER_APP_PROFILE_STRING' => 'Internet Explorer'
    'FPS_BROWSER_USER_PROFILE_STRING' => 'Default'
    'HOMEDRIVE' => 'C:'
    'HOMEPATH' => '\\Users\\jimme'
    'INTEL_DEV_REDIST' => 'C:\\Program Files (x86)\\Common Files\\Intel\\Shared Libraries\\'
    'LOCALAPPDATA' => 'C:\\Users\\jimme\\AppData\\Local'
    'LOGONSERVER' => '\\\\DESKTOP-R7F7LDM'
    'MIC_LD_LIBRARY_PATH' => 'C:\\Program Files (x86)\\Common Files\\Intel\\Shared Libraries\\compiler\\lib\\mic'
    'NUMBER_OF_PROCESSORS' => '12'
    'OPENSSL_CONF' => 'c:\\winnmp\\conf\\openssl.conf'
    'OS' => 'Windows_NT'
    'PATHEXT' => '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.RB;.RBW'
    'PROCESSOR_ARCHITECTURE' => 'AMD64'
    'PROCESSOR_IDENTIFIER' => 'Intel64 Family 6 Model 62 Stepping 4, GenuineIntel'
    'PROCESSOR_LEVEL' => '6'
    'PROCESSOR_REVISION' => '3e04'
    'ProgramData' => 'C:\\ProgramData'
    'ProgramFiles' => 'C:\\Program Files'
    'ProgramFiles(x86)' => 'C:\\Program Files (x86)'
    'ProgramW6432' => 'C:\\Program Files'
    'PSModulePath' => '%ProgramFiles%\\WindowsPowerShell\\Modules;C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\Modules'
    'PUBLIC' => 'C:\\Users\\Public'
    'SESSIONNAME' => 'Console'
    'SystemDrive' => 'C:'
    'SystemRoot' => 'C:\\WINDOWS'
    'TEMP' => 'c:\\winnmp\\tmp'
    'TMP' => 'c:\\winnmp\\tmp'
    'USERDOMAIN' => 'DESKTOP-R7F7LDM'
    'USERDOMAIN_ROAMINGPROFILE' => 'DESKTOP-R7F7LDM'
    'USERNAME' => 'jimme'
    'USERPROFILE' => 'C:\\Users\\jimme'
    'windir' => 'C:\\WINDOWS'
    'WINNMP' => 'windows'
    'HTTP_ACCEPT_LANGUAGE' => 'en-US,en;q=0.9'
    'HTTP_ACCEPT_ENCODING' => 'gzip, deflate'
    'HTTP_ACCEPT' => 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3'
    'HTTP_USER_AGENT' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36'
    'HTTP_UPGRADE_INSECURE_REQUESTS' => '1'
    'HTTP_CONNECTION' => 'keep-alive'
    'HTTP_HOST' => 'merkhaus.test'
    'REDIS' => 'localhost'
    'HTTP_MOD_REWRITE' => 'on'
    'WTSERVER' => 'windows'
    'WT_SITE' => 'merkhaus.test'
    'SERVER_SITE' => 'merkhaus.test'
    'SERVER_NAME' => 'merkhaus.test'
    'REDIRECT_STATUS' => '200'
    'SERVER_PORT' => '80'
    'SERVER_ADDR' => '127.0.0.1'
    'REMOTE_PORT' => '31478'
    'REMOTE_ADDR' => '127.0.0.1'
    'SERVER_SOFTWARE' => 'nginx/1.15.9'
    'GATEWAY_INTERFACE' => 'CGI/1.1'
    'REQUEST_SCHEME' => 'http'
    'SERVER_PROTOCOL' => 'HTTP/1.1'
    'DOCUMENT_ROOT' => 'c:/WinNMP/www/merkhaus/web'
    'DOCUMENT_URI' => '/index.php'
    'REQUEST_URI' => '/index.php?p=admin/install'
    'SCRIPT_NAME' => '/index.php'
    'CONTENT_LENGTH' => ''
    'CONTENT_TYPE' => ''
    'REQUEST_METHOD' => 'GET'
    'QUERY_STRING' => 'p=admin/install'
    'SCRIPT_FILENAME' => 'c:/WinNMP/www/merkhaus/web/index.php'
    'PATH_INFO' => ''
    'FCGI_ROLE' => 'RESPONDER'
    'PHP_SELF' => ''
    'REQUEST_TIME_FLOAT' => 1557070457.5755
    'REQUEST_TIME' => 1557070457
    'ENVIRONMENT' => 'dev'
    'SECURITY_KEY' => '••••••••••••••••••••••••••••••••'
    'DB_DRIVER' => 'mysql'
    'DB_SERVER' => 'localhost'
    'DB_USER' => '••••••••••'
    'DB_PASSWORD' => '••••••••••'
    'DB_DATABASE' => 'merkhaus'
    'DB_SCHEMA' => ''
    'DB_TABLE_PREFIX' => ''
    'DB_PORT' => '3366'
    'DEFAULT_SITE_URL' => '/'
    'ASSET_BASE_URL' => 'http://merkhaus.test/images'
    'GOOGLE_CLOUD_STORAGE_PROJECT_ID' => '••••••••••'
]

and my .env file ...

ENVIRONMENT="dev"

SECURITY_KEY="*************************"

DB_DRIVER="mysql"

DB_SERVER="localhost"

DB_USER="**********"

DB_PASSWORD="*******************"

DB_DATABASE="merkhaus"

DB_SCHEMA=""

DB_TABLE_PREFIX=""

DB_PORT="3366"

DEFAULT_SITE_URL="/"

ASSET_BASE_URL="http://merkhaus.test/images"

GOOGLE_CLOUD_STORAGE_PROJECT_ID="**************"

2 Answers 2

3

Found the problem. I had to remove putenv from the disabled functions in php.ini

1

In my case I was missing the .env file in my Atomic SFTP deploy. 🤦🏼‍♂️

So the DB_DRIVER setting was not there...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.