-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Install issue #3
Comments
@algebris After you setup your connection in
And making sure that you type the |
I have the same problem.
when echo db variable in backend app, it shows I actually insert mysql connectionstring in common/config/env/dev.php please give me some advice. |
When you share common config make sure you REMOVE that setting from the backend / frontend / console (check your env.php on those places and also remove it from the environment config files) Cheers Enviado desde mi BlackBerry® de Vodafone -----Original Message----- I have the same problem.
when echo db variable in backend app, it shows I actually insert mysql connectionstring in common/config/env/dev.php please give me some advice. Reply to this email directly or view it on GitHub: |
I have deleted and also deleted env folder now I have only configs belows: but backend app unable to connect database which config in common/config/env/dev.php Thanks. |
Make sure you remove the config for db at the environment folders too. And then run the composer install again. Before, delete the composer.lock file and vendor folder. |
OK. I follow steps below as you mention and make sure that remove all the configs for db:
'connectionString' => 'sqlite:C:\wamp\www\test_web\common\config/../data/testdrive.db' Thanks. |
More info. I do var dump in Yiinitializr.config function. Below is output. array(6) { and look into Yiinitializr.build function. Thanks. |
It does... first the backend, then main, env, local, and last the env and local of backend config Please, look for that connectionString to find out where is located |
OK I already searched all connectionString in backend, frontend, console, api, common but there are 2 connectionString section surely. then i try to var dump in Yiinitializr.build function. the result is shown below: input parameters to Yiinitializr.build function array(6) {
[0]=> string(7) "backend"
[1]=> string(59) "C:\wamp\www\test_web\backend\www/../../common/config/main.php"
[2]=> string(58) "C:\wamp\www\test_web\backend\www/../../common/config/env.php"
[3]=> string(60) "C:\wamp\www\test_web\backend\www/../../common/config/local.php"
[4]=> string(3) "env"
[5]=> string(5) "local" } var dump in Yiinitializr.build function string(88) "C:\wamp\www\test_web\common\lib\Yiinitializr\config/../../../../backend/config/backend.php"
string(59) "C:\wamp\www\test_web\backend\www/../../common/config/main.php"
string(58) "C:\wamp\www\test_web\backend\www/../../common/config/env.php"
string(84) "C:\wamp\www\test_web\common\lib\Yiinitializr\config/../../../../backend/config/env.php" then look in deep in that function (Yiinitializr.build) foreach ($files as $file)
{
$config = file_exists($file) && is_file($file)
? require($file)
: (is_string($file) && file_exists($directory . '/' . $file . '.php')
? require($directory . '/' . $file . '.php')
: array());
if (is_array($config))
$result = ArrayX::merge($result, $config);
} above function is not look into ex. common/config/env/dev.php My yiinitializr-advanced is fresh installed. |
Lets get back to basics: Try to have one single point connection string: at the common/config/main.php. Remove the others! There is no need to have multiple connectionstrings for backend or frontend atm. Make sure you only have one connectionstring. Once you find out it works, lets upgrade, that means, try to connect to different database config on your env.php file (the file created by |
The key point is different environment make different database connection string. In dev environment the connection string should be in env/dev.php How do you handle in this case? save connection string in env.php or dev.php? |
Hi, Antonio, I'm getting this error:
Can you help me on this please? Thanks |
@minkbear if i work with one database for both backend / frontend and we have different environments. We do configure @flyzard Thats an issue with composer. Try to update the |
If you are using MySQL, make sure you have the PHP mysql (PDO) extension installed. |
Can't install, catching db connection exception.
[CDbException]
CDbConnection failed to open the DB connection.
i've just changed all config files like common/config/env.php, dev.php, prod.php in order to connect to database successfully but without result. What i'm doing wrong? Can't install it quickly
The text was updated successfully, but these errors were encountered: