Help for integrating the Laravel package
Forum rules: Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
#4002 by Mostafa
07 Mar 2017, 04:32
I got an error after executing
Code: Select allphp artisan aimeos:setup --option=setup/default/demo:1


The error message is:
Code: Select all[Aimeos\MW\Setup\Exception]
Configuration parameter "adapter" missing in "db"


Do you know what is this error about?
I checked database connection and it seems to be ok.

php-version: 7.0.15
Aimeos version: 2017.03.1
ubuntu 16.04
#4003 by aimeos
07 Mar 2017, 10:46
The problem is the ".env" file. Please check if it contains the "DB_CONNECTION" variable set correctly

Sometimes, it also doesn't work as expected. Ddd your database configuration to your "./config/shop.php" file directly in this case:
https://github.com/aimeos/aimeos-laravel/blob/master/src/config/shop.php#L29
#4034 by Iago Calazans
14 Mar 2017, 16:04
"Add your database configuration to your "./config/shop.php" file directly in this case" - nothing happens, receive the same message.

In order to make it work for me, i had to pass the array['db'] values manually into the Multiple.php file. :shock:

Before ...foreach( $dbconfig as $rname => $dbconf )... on line 56, i insert:

$dbconfig = array('db' => array('adapter' => 'mysql', 'database' => 'sdbdev'));

Why to do that? I notice that $dbconfig var didn't receive the array structure, pulling only the first nivel 'db' -> array (0);

php-version: 7.0.16
Aimeos version: 2017.03.1
CentOS 6.5
#4037 by aimeos
14 Mar 2017, 21:37
Did you add all necessary database configuration to your ./config/shop.php (adapter, host, port, database, username, password and stmts)? If yes, does it work if you remove the "env()" function and use only the literal strings?
Code: Select all   'resource' => array(
      'db' => array(
         'adapter' => 'mysql',
         'host' => 'localhost',
         'port' => '',
         'database' => 'laravel',
         'username' => 'root',
         'password' => 'secret',
         'stmt' => array( "SET NAMES 'utf8'", "SET SESSION sql_mode='ANSI'" ),
      ),
   ),
#4038 by Iago Calazans
14 Mar 2017, 22:18
aimeos wrote:Did you add all necessary database configuration to your ./config/shop.php (adapter, host, port, database, username, password and stmts)? If yes, does it work if you remove the "env()" function and use only the literal strings?
Code: Select all   'resource' => array(
      'db' => array(
         'adapter' => 'mysql',
         'host' => 'localhost',
         'port' => '',
         'database' => 'laravel',
         'username' => 'root',
         'password' => 'secret',
         'stmt' => array( "SET NAMES 'utf8'", "SET SESSION sql_mode='ANSI'" ),
      ),
   ),


Yes and No. I add all the necessary database config, but even removing the "env()" it still does not work. The only way i found was a manual insert of the code line "$dbconfig = array('db' => array('adapter' => 'mysql', 'database' => 'sdbdev'));" and running php artisan aimeos:setup. After then remove the code.
#4047 by Iago Calazans
20 Mar 2017, 04:43
aimeos wrote:That can't be the solution :-/
Can you post your full ./config/shop.php file and the error message thrown by the "./artisan aimeos:setup" command?


Code: Select all<?php

return array(

   'routes' => array(
      // 'login' => array('middleware' => ['web']),
      // 'admin' => array('middleware' => ['web', 'auth']),
      // 'account' => array('middleware' => ['web', 'auth']),
      // 'jsonapi' => array('middleware' => ['web']),
      // 'default' => array('middleware' => ['web']),
      // 'confirm' => array('middleware' => ['web']),
      // 'update' => array(),
   ),

   'page' => array(
      // 'account-index' => array( 'account/profile','account/history','account/favorite','account/watch','basket/mini','catalog/session' ),
      // 'basket-index' => array( 'basket/standard','basket/related' ),
      // 'catalog-count' => array( 'catalog/count' ),
      // 'catalog-detail' => array( 'basket/mini','catalog/stage','catalog/detail','catalog/session' ),
      // 'catalog-list' => array( 'basket/mini','catalog/filter','catalog/stage','catalog/lists' ),
      // 'catalog-stock' => array( 'catalog/stock' ),
      // 'catalog-suggest' => array( 'catalog/suggest' ),
      // 'checkout-confirm' => array( 'checkout/confirm' ),
      // 'checkout-index' => array( 'checkout/standard' ),
      // 'checkout-update' => array( 'checkout/update'),
   ),

   'resource' => array(
      'db' => array(
         'adapter' => 'mysql',
         'host' => 'localhost',
         'port' => '',
         'database' => 'sctdb',
         'username' => 'root',
         'password' => '',
         'stmt' => array( "SET NAMES 'utf8'", "SET SESSION sql_mode='ANSI'" ),
     ),
   ),


   'admin' => array(),

   'client' => array(
      'html' => array(
         'common' => array(
            'content' => array(
               // 'baseurl' => '/',
            ),
            'template' => array(
               // 'baseurl' => 'packages/aimeos/shop/themes/elegance',
            ),
         ),
      ),
   ),

   'controller' => array(
   ),

   'i18n' => array(
   ),

   'madmin' => array(
   ),

   'mshop' => array(
   ),


   'command' => array(
   ),

   'frontend' => array(
   ),

   'backend' => array(
   ),
);


And the error is:

[Aimeos\MW\Setup\Exception]
Configuration parameter "adapter" missing in "db"
#4048 by aimeos
20 Mar 2017, 18:19
We get the same problem when using the default "./config/shop.php" because it contains these lines:
Code: Select all   'resource' => array(
      'db' => array(
         // 'adapter' => env('DB_CONNECTION', 'mysql'),
         // 'host' => env('DB_HOST', 'localhost'),
         // 'port' => env('DB_PORT', ''),
         // 'socket' => '',
         // 'database' => env('DB_DATABASE', 'laravel'),
         // 'username' => env('DB_USERNAME', 'root'),
         // 'password' => env('DB_PASSWORD', ''),
         // 'stmt' => array( "SET NAMES 'utf8'", "SET SESSION sql_mode='ANSI'" ),
      ),
   ),

They cause an empty "resource/db" array in the Aimeos setup command but removing all comments works:
Code: Select all   'resource' => array(
      'db' => array(
         'adapter' => env('DB_CONNECTION', 'mysql'),
         'host' => env('DB_HOST', 'localhost'),
         'port' => env('DB_PORT', ''),
         'socket' => '',
         'database' => env('DB_DATABASE', 'laravel'),
         'username' => env('DB_USERNAME', 'root'),
         'password' => env('DB_PASSWORD', ''),
         'stmt' => array( "SET NAMES 'utf8'", "SET SESSION sql_mode='ANSI'" ),
      ),
   ),

What works too is to comment out the whole block:
Code: Select all/*
   'resource' => array(
      'db' => array(
         'adapter' => env('DB_CONNECTION', 'mysql'),
         'host' => env('DB_HOST', 'localhost'),
         'port' => env('DB_PORT', ''),
         'socket' => '',
         'database' => env('DB_DATABASE', 'laravel'),
         'username' => env('DB_USERNAME', 'root'),
         'password' => env('DB_PASSWORD', ''),
         'stmt' => array( "SET NAMES 'utf8'", "SET SESSION sql_mode='ANSI'" ),
      ),
   ),
*/

Then, the default resource configuration is used.