Connection info of production server (JSON)

I’m trying to use the advanced setting, "Connection info of production server (JSON) to specify server-side connection info, with the following connection string:

{ "DB": { "user": "clinicalmatchme_app", "password": "MY_PASSWORD", "host": "ls-85991bce961d76720544368a68fe166bb0702903.civ41r4og66y.us-east-1.rds.amazonaws.com", "port": 3306, "driver": "pdo_mysql" } }

However, it displays an error when connecting and I see the following in the error log:

[2020-12-20T15:13:23.610832-05:00] log.DEBUG: Slim Application Error Type: Doctrine\DBAL\Exception\ConnectionException Code: 0 Message: An exception occurred in driver: No such file or directory File: /usr/local/lsws/sites/clinicalmatchme.com/httpdocs/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php Line: 112 Trace: 
#0 /usr/local/lsws/sites/clinicalmatchme.com/httpdocs/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(182): Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\DBAL\Driver\Mysqli\Exception\ConnectionFailed)) 
#1 /usr/local/lsws/sites/clinicalmatchme.com/httpdocs/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(169): Doctrine\DBAL\DBALException::wrapException(Object(Doctrine\DBAL\Driver\Mysqli\Driver), Object(Doctrine\DBAL\Driver\Mysqli\Exception\ConnectionFailed), 'An exception oc...') 
#2 /usr/local/lsws/sites/clinicalmatchme.com/httpdocs/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/Driver.php(18): Doctrine\DBAL\DBALException::driverException(Object(Doctrine\DBAL\Driver\Mysqli\Driver), Object(Doctrine\DBAL\Driver\Mysqli\Exception\ConnectionFailed)) 
#3 /usr/local/lsws/sites/clinicalmatchme.com/httpdocs/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(362): Doctrine\DBAL\Driver\Mysqli\Driver->connect(Array, 'clinicalmatchme...', 'eorFPPK6Qg@cXZ6...', Array) 
#4 /usr/local/lsws/sites/clinicalmatchme.com/httpdocs/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1853): Doctrine\DBAL\Connection->connect() 
#5 /usr/local/lsws/sites/clinicalmatchme.com/httpdocs/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1241): Doctrine\DBAL\Connection->getWrappedConnection() 
#6 /usr/local/lsws/sites/clinicalmatchme.com/httpdocs/app/src/phpfn.php(5654): Doctrine\DBAL\Connection->executeQuery('SELECT COUNT(*)...') 
#7 /usr/local/lsws/sites/clinicalmatchme.com/httpdocs/app/src/phpfn.php(5808): PHPMaker2021\CMM_App\ExecuteQuery('SELECT COUNT(*)...', NULL) 
#8 /usr/local/lsws/sites/clinicalmatchme.com/httpdocs/app/src/userfn.php(128): PHPMaker2021\CMM_App\ExecuteScalar('SELECT COUNT(*)...') 
#9 /usr/local/lsws/sites/clinicalmatchme.com/httpdocs/app/models/Login.php(264): PHPMaker2021\CMM_App\Page_Loading() 
#10 /usr/local/lsws/sites/clinicalmatchme.com/httpdocs/app/controllers/ControllerBase.php(50): PHPMaker2021\CMM_App\Login->run() 
#11 /usr/local/lsws/sites/clinicalmatchme.com/httpdocs/app/controllers/OthersController.php(27): PHPMaker2021\CMM_App\ControllerBase->runPage(Object(Slim\Http\ServerRequest), Object(Slim\Http\Response), Array, 'Login') 
#12 /usr/local/lsws/sites/clinicalmatchme.com/httpdocs/app/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php(43): PHPMaker2021\CMM_App\OthersController->login(Object(Slim\Http\ServerRequest), Object(Slim\Http\Response), Array)
#13 /usr/local/lsws/sites/clinicalmatchme.com/httpdocs/app/vendor/slim/slim/Slim/Routing/Route.php(384): Slim\Handlers\Strategies\RequestResponse->__invoke(Array, Object(Slim\Http\ServerRequest), Object(Slim\Http\Response), Array) 
#14 /usr/local/lsws/sites/clinicalmatchme.com/httpdocs/app/src/PermissionMiddleware.php(115): Slim\Routing\Route->handle(Object(Slim\Http\ServerRequest)) 
#15 /usr/local/lsws/sites/clinicalmatchme.com/httpdocs/app/vendor/slim/slim/Slim/MiddlewareDispatcher.php(209): PHPMaker2021\CMM_App\PermissionMiddleware->__invoke(Object(Slim\Http\ServerRequest), Object(Slim\Routing\Route)) 
#16 /usr/local/lsws/sites/clinicalmatchme.com/httpdocs/app/vendor/slim/slim/Slim/MiddlewareDispatcher.php(81): class@anonymous->handle(Object(Slim\Http\ServerRequest)) 
#17 /usr/local/lsws/sites/clinicalmatchme.com/httpdocs/app/vendor/slim/slim/Slim/MiddlewareDispatcher.php(81): Slim\MiddlewareDispatcher->handle(Object(Slim\Http\ServerRequest)) #18 /usr/local/lsws/sites/clinicalmatchme.com/httpdocs/app/vendor/slim/slim/Slim/Routing/Route.php(341): Slim\MiddlewareDispatcher->handle(Object(Slim\Http\ServerRequest)) #19 /usr/local/lsws/sites/clinicalmatchme.com/httpdocs/app/vendor/slim/slim/Slim/Routing/RouteRunner.php(84): Slim\Routing\Route->run(Object(Slim\Http\ServerRequest)) #20 /usr/local/lsws/sites/clinicalmatchme.com/httpdocs/app/vendor/slim/slim/Slim/Middleware/BodyParsingMiddleware.php(68): Slim\Routing\RouteRunner->handle(Object(Slim\Http\ServerRequest)) #21 /usr/local/lsws/sites/clinicalmatchme.com/httpdocs/app/vendor/slim/slim/Slim/MiddlewareDispatcher.php(147): Slim\Middleware\BodyParsingMiddleware->process(Object(Slim\Http\ServerRequest), Object(Slim\Routing\RouteRunner)) #22 /usr/local/lsws/sites/clinicalmatchme.com/httpdocs/app/src/CorsMiddleware.php(32): class@anonymous->handle(Object(Slim\Http\ServerRequest)) #23 /usr/local/lsws/sites/clinicalmatchme.com/httpdocs/app/vendor/slim/slim/Slim/MiddlewareDispatcher.php(147): PHPMaker2021\CMM_App\CorsMiddleware->process(Object(Slim\Http\ServerRequest), Object(class@anonymous)) #24 /usr/local/lsws/sites/clinicalmatchme.com/httpdocs/app/vendor/slim/slim/Slim/Middleware/RoutingMiddleware.php(59): class@anonymous->handle(Object(Slim\Http\ServerRequest)) #25 /usr/local/lsws/sites/clinicalmatchme.com/httpdocs/app/vendor/slim/slim/Slim/MiddlewareDispatcher.php(147): Slim\Middleware\RoutingMiddleware->process(Object(Slim\Http\ServerRequest), Object(class@anonymous)) #26 /usr/local/lsws/sites/clinicalmatchme.com/httpdocs/app/vendor/selective/samesite-cookie/src/SameSiteCookieMiddleware.php(52): class@anonymous->handle(Object(Slim\Http\ServerRequest)) #27 /usr/local/lsws/sites/clinicalmatchme.com/httpdocs/app/vendor/slim/slim/Slim/MiddlewareDispatcher.php(147): Selective\SameSiteCookie\SameSiteCookieMiddleware->process(Object(Slim\Http\ServerRequest), Object(class@anonymous)) #28 /usr/local/lsws/sites/clinicalmatchme.com/httpdocs/app/vendor/selective/samesite-cookie/src/SameSiteSessionMiddleware.php(50): class@anonymous->handle(Object(Slim\Http\ServerRequest)) #29 /usr/local/lsws/sites/clinicalmatchme.com/httpdocs/app/vendor/slim/slim/Slim/MiddlewareDispatcher.php(147): Selective\SameSiteCookie\SameSiteSessionMiddleware->process(Object(Slim\Http\ServerRequest), Object(class@anonymous)) #30 /usr/local/lsws/sites/clinicalmatchme.com/httpdocs/app/vendor/slim/slim/Slim/Middleware/ErrorMiddleware.php(107): class@anonymous->handle(Object(Slim\Http\ServerRequest)) #31 /usr/local/lsws/sites/clinicalmatchme.com/httpdocs/app/vendor/slim/slim/Slim/MiddlewareDispatcher.php(147): Slim\Middleware\ErrorMiddleware->process(Object(Slim\Http\ServerRequest), Object(class@anonymous)) #32 /usr/local/lsws/sites/clinicalmatchme.com/httpdocs/app/vendor/slim/slim/Slim/MiddlewareDispatcher.php(81): class@anonymous->handle(Object(Slim\Http\ServerRequest)) #33 /usr/local/lsws/sites/clinicalmatchme.com/httpdocs/app/vendor/slim/slim/Slim/App.php(215): Slim\MiddlewareDispatcher->handle(Object(Slim\Http\ServerRequest)) #34 /usr/local/lsws/sites/clinicalmatchme.com/httpdocs/app/vendor/slim/slim/Slim/App.php(199): Slim\App->handle(Object(Slim\Http\ServerRequest)) #35 /usr/local/lsws/sites/clinicalmatchme.com/httpdocs/app/index.php(116): Slim\App->run() 
#36 {main}

It looks like it’s trying to load AbstractMySQLDriver.php, but this file does not exist on the server and is not generated by PHPMaker.

Double check your JSON. It seems you missed the dbname part.

You cannot change driver to “pdo_mysql” by Connection info of production server (JSON), you may change it by the advanced setting MySQL driver.

I added the dbname property and removed the driver property, but it’s still getting the same error.

Make sure you have already enabled Composer update. After that, re-generated ALL the script files, then upload all the generated script files in vendor sub-folder to your hosting server.

According to the error message, the file AbstractMySQLDriver.php is there, but it cannot find the file for the MySQL driver. As suggested:

You cannot change driver to “pdo_mysql” by Connection info of production server (JSON), you may change it by the advanced setting MySQL driver.

If your server requires pdo_mysql, you may click Tools → Advanced Settings:

  • Remove , “driver”: “pdo_mysql” from your setting for Connection info of production server (JSON)
  • Change MySQL driver to “pdo_mysql”

Generate files again and upload again to test.

I figured it out, thanks.