# php-fpm + nginx + mysql + CakePHP issues



## Ltd. Commander Data (Nov 10, 2017)

I try to use CakePHP on my (non public) FreeBSD development server (10.3 RELEASE).
It runs nginx 1.12.1, php 5.6.31 and mySQL Server 5.6.37.
phpinfo() says, that the mysql support is enabled and a simple phpBB3 forum runs like charm, nevertheless I get this error message when I try to open a sample CakePHP project:

"Database driver Cake\Database\Driver\Mysql cannot be used due to a missing PHP extension or unmet dependency"

There are no errors in nginx/error.log.

The CakePHP error.log:


```
2017-11-10 11:52:42 Error: [Cake\Database\Exception\MissingExtensionException] Database driver Cake\Database\Driver\Mysql cannot be used due to a missing PHP extension or unmet dependency in /usr/local/www/my_app_name/vendor/cakephp/cakephp/src/Database/Connection.php on line 176
Exception Attributes: array (
  'driver' => 'Cake\\Database\\Driver\\Mysql',
)
Stack Trace:
#0 /usr/local/www/my_app_name/vendor/cakephp/cakephp/src/Database/Connection.php(117): Cake\Database\Connection->setDriver('Cake\\Database\\D...', Arra
y)
#1 /usr/local/www/my_app_name/vendor/cakephp/cakephp/src/Datasource/ConnectionRegistry.php(89): Cake\Database\Connection->__construct(Array)
#2 /usr/local/www/my_app_name/vendor/cakephp/cakephp/src/Core/ObjectRegistry.php(96): Cake\Datasource\ConnectionRegistry->_create('Cake\\Database\\C...
', 'default', Array)
#3 /usr/local/www/my_app_name/vendor/cakephp/cakephp/src/Datasource/ConnectionManager.php(205): Cake\Core\ObjectRegistry->load('default', Array)
#4 /usr/local/www/my_app_name/vendor/cakephp/debug_kit/src/Panel/SqlLogPanel.php(50): Cake\Datasource\ConnectionManager::get('default')
#5 /usr/local/www/my_app_name/vendor/cakephp/debug_kit/src/ToolbarService.php(151): DebugKit\Panel\SqlLogPanel->initialize()
#6 /usr/local/www/my_app_name/vendor/cakephp/debug_kit/src/Middleware/DebugKitMiddleware.php(51): DebugKit\ToolbarService->initializePanels()
#7 /usr/local/www/my_app_name/vendor/cakephp/cakephp/src/Http/Runner.php(65): DebugKit\Middleware\DebugKitMiddleware->__invoke(Object(Cake\Http\ServerR
equest), Object(Cake\Http\Response), Object(Cake\Http\Runner))
#8 /usr/local/www/my_app_name/vendor/cakephp/cakephp/src/Http/Runner.php(51): Cake\Http\Runner->__invoke(Object(Cake\Http\ServerRequest), Object(Cake\H
ttp\Response))
#9 /usr/local/www/my_app_name/vendor/cakephp/cakephp/src/Http/Server.php(81): Cake\Http\Runner->run(Object(Cake\Http\MiddlewareQueue), Object(Cake\Http
\ServerRequest), Object(Cake\Http\Response))
#10 /usr/local/www/my_app_name/webroot/index.php(40): Cake\Http\Server->run()
#11 /usr/local/www/my_app_name/index.php(16): require('/usr/local/www/...')
#12 {main}
```


----------



## azathoth (Nov 10, 2017)

Ltd. Commander Data said:


> I try to use CakePHP on my (non public) FreeBSD development server (10.3 RELEASE).
> It runs nginx 1.12.1, php 5.6.31 and mySQL Server 5.6.37.
> phpinfo() says, that the mysql support is enabled and a simple phpBB3 forum runs like charm, nevertheless I get this error message when I try to open a sample CakePHP project:
> 
> ...




11.1 is out

https://book.cakephp.org/3.0/en/installation.html

I would carefully setup g-wan with php 7 and go from there.
Postgresql 10 backend right?


----------



## Ltd. Commander Data (Nov 21, 2017)

At first I updated to 11.1 and ran into the same problem.
It was solved by installing php56-pdo-mysql.


----------



## SirDice (Nov 22, 2017)

azathoth said:


> 11.1 is out


FreeBSD 10.3 is supported till April 2018. Then there's also 10.4 which will be supported until October 2018.

https://www.freebsd.org/security/security.html#sup


----------



## azathoth (Nov 22, 2017)

why not upgrade!!??



posgresql for the win!

ever try yii?   seems the coolest php framework


----------



## Ltd. Commander Data (Nov 24, 2017)

I'll give yii a try... Thanks!


----------

