I have installed Laravel 5.1 and try to connect with mongoDB. I have donwload jenssegers/mongodb I have follow the instrucction but when I go to my app "localhost/myapp/public" it is a empty page, there is nothing.
I have added the service provider:
Jenssegers\Mongodb\MongodbServiceProvider::class,
Jenssegers\Mongodb\Auth\PasswordResetServiceProvider::class
the alias:
'Moloquent' => Jenssegers\Mongodb\Model::class
and my config/databese is:
'mongodb' => [
'driver' => 'mongodb',
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', 27017),
'database' => env('DB_DATABASE', 'myappdb'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', '12345'),
'options' =>['db' => 'admin']
]
Anyone knows that is wrong? :(
Thanks you!
make .env file
APP_ENV=local
APP_DEBUG=true
APP_KEY=****************************
DB_CONNECTION=mongodb
DB_HOST=localhost
DB_DATABASE=DB Name
DB_USERNAME=username
DB_PASSWORD=******
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
Then give sudo chmod -Rf 0777 storage/ and vendor/ folder
Related
I am using lumen 9.0.
$response = Storage::disk('ftp')->put('path-to-remote-server', $fileContent)
In $response i am getting 1(true) as response but file is not uploading to remote server.
My filesystem.php
'ftp' => [
'driver' => 'sftp',
'host' => 'host-ip',
'username' => '****',
'password' => '****',
],
My Composer Json has below library installed
"league/flysystem-sftp-v3": "^3.0",
"phpseclib/phpseclib": "^3.0"
I Installed mongoDB in my laravel 8 project for first time, to explore mongoDB functionalities
When I run php artisan migrate I got:
MongoDB\Driver\Exception\AuthenticationException
Authentication failed.
at D:\xampp\htdocs\Mongo\mongonews\vendor\mongodb\mongodb\src\Command\ListCollections.php:115
my : D:\xampp\htdocs\Mongo\mongonews\config\database.php I set the following:
'mongodb' => [
'driver' => 'mongodb',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', 27017),
'database' => env('DB_DATABASE'),
'username' => env('DB_USERNAME'),
'password' => env('DB_PASSWORD'),
'options' => [
// here you can pass more settings to the Mongo Driver Manager
// see https://www.php.net/manual/en/mongodb-driver-manager.construct.php under "Uri Options" for a list of complete parameters that you can use
'database' => env('DB_AUTHENTICATION_DATABASE', 'admin'), // required with Mongo 3+
],
],
And this is my .env:
DB_HOST=127.0.0.1
DB_PORT=27017
DB_DATABASE=mongonews
DB_USERNAME=root
DB_PASSWORD=
Thanks Geaks, appreciate your help to start my first time mongo db based laravel app
All the best.
It was solved by removing username from DB_USERNAME
although It is supposed to be "root" in my case!!!!
DB_CONNECTION=mongodb
DB_HOST=127.0.0.1
DB_PORT=27017
DB_DATABASE=news
DB_USERNAME=
DB_PASSWORD=
Hope this helps who ever faced this problem.
I want to disable Magento Review module and modify the etc/config.php
'Magento_Review' => 0,
the review module did disable, but now a lot of the settings in admin interface are grayed out
How to restore changes and put it back to be able to edit settings in admin?
Any help is appreciated.
I found that it's a configuration issue in either config.php or env.php
For myself, I found that I had a configuration issue in my env.php whereby I had 2 areas referencing different databases:
'db' => [
'connection' => [
'indexer' => [
'host' => 'mysql',
'dbname' => 'my_db_2',
'username' => 'user',
'password' => 'pass',
'active' => '1',
'persistent' => NULL,
'model' => 'mysql4',
'engine' => 'innodb',
'initStatements' => 'SET NAMES utf8;'
],
'default' => [
'host' => 'mysql',
'dbname' => 'my_db_1',
'username' => 'user',
'password' => 'pass',
'active' => '1',
'model' => 'mysql4',
'engine' => 'innodb',
'initStatements' => 'SET NAMES utf8;'
]
],
'table_prefix' => ''
],
Had my_db_1 in 1 and my_db_2 in the other. Upon matching these I ran:
php bin/magento app:config:import && \
php bin/magento setup:upgrade && \
php bin/magento cache:flush
And the configuration was no longer greyed out / disabled / unchangeable.
For a project I use Slim 3 - Twig and Eloquent. On development mode, all works perfectly, but on production, hosted in the OVH shared server, I can't access to the database.
I'm hundred percent sure of credentials and the database was not created right now.
This is my code :
$capsule = new \Illuminate\Database\Capsule\Manager;
$capsule->addConnection($config['db']);
$capsule->bootEloquent();
$capsule->setAsGlobal();
Where $config['db'] contains the informations required by Eloquent :
$config = [
'settings' => [
'debug' => true,
'displayErrorDetails' => true
],
'db' => [
'driver' => 'mysql',
'host' => '****.mysql.db',
'database' => '****',
'username' => '****',
'password' => '****',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => ''
]
]
What I have to do to make it work ?
Ok ... I get the solution.
... Suspense ...
I have to remove spaces around the big arrows in my beautiful formatted array.
Yes. I'm gonna cry.
I use Yii2, db connection
'db' => [
'class' => 'yii\db\Connection',
'dsn' => 'pgsql:host=localhost;dbname=data-storage',
'username' => 'data-storage',
'password' => '',
'charset' => 'utf8',
]
My database does not have a password. I got an error: SQLSTATE[08006] [7] fe_sendauth: no password supplied.
If I use some password (just fake, as I mentioned I don't have it) I'm getting: password authentication failed for user "data-storage"
In pg_hba.conf I have a record for my domain:
host all all 172.28.3.70/32 trust
Which works fine for PgAdmin.
I figured it out, I have used localhost instead of the server IP where the database is located.
try this
return [
'class' => 'yii\db\Connection',
'dsn' => 'pgsql:host=localhost;dbname=db_name',
'username' => 'db_username',
'password' => NULL,
'charset' => 'utf8',
'schemaMap' => [
'pgsql'=> [
'class'=>'yii\db\pgsql\Schema',
'defaultSchema' => 'public' //specify your schema here
]
], // PostgreSQL
];
or remove password.