Im running a new Laravel project and getting this error ,"You're using the default database name laravel. This database does not exist. Edit the .env file and use the correct database name in the DB_DATABASE key.", But what's confusing is, its not the first time running a Laravel project,but I have never encountered such. Anyone to help?. Thanks in advance.
I had to reset the configuration in my PhpStorm, it was calling for PHP 7.4 yet my installed version was 7.2. Thanks to those who responded, I appreciate.
There are two options;
If you are using Homestead then you need to configure your database connection as thus;
DB_DATABASE=name_of_database
DB_USERNAME=homestead
DB_PASSWORD=secret
If your environment is out of Homestead, then use the credentials you use when logging in to localhost/phpmyadmin
I hope it helps.
Related
I build API project using Laravel 8, and I put my project on Git. My production server using Ubuntu Apache. I use only 1 database, and it's use on my local and production server.
I have weird problem since yesterday and make me confused. So, I push the latest commit to my Server from Local Server. Everything went well. But when I try to run my API via Postman, the results from my Local and Production server are different.
I checked manually in the files I pushed from local, everything is exactly same.
I try git status, everything OK. git pull are up to date. Here i attach the screenshoot.
Since i use laravel, i try to clear cache with php artisan cache:clear and it doesn't work.
Here i attach my Postman result:
As you can see, the result are different. I believe, there is no error with my code, It's work well on my Local server.
I try to contact my server provider, but didn't get any solution.
Anyway, this is Header from Prod Server
I'll appreciate all the answer from this thread. Thank you
Are you working on same branch in local and server? check your git branches in both.
Thank you for the answer and comment.
I already solve this problem. The problem pure from my production file and server.
first i try to restart my docker, and then run php artisan config:clear.
I have a Laravel 5.5 app using Stripe for subscriptions, deployed on Forge/Digital Ocean.
Everything has been working fine for many months, but today both environmental variables env('PUB_STRIPE_API_KEY') and env('STRIPE_API_KEY') are showing as not present (if(empty) is coming up true for both variables) and Stripe functionality is therefore stopped. Both are present and accounted for in my .ENV file.
STRIPE_API_KEY=sk_test_fPpKzHV49vImGOh4Aqxxxxxx
PUB_STRIPE_API_KEY=pk_test_HrVhWbsRL90qm7RrCbxxxxxx
However, my identical local development instance works just fine. Both were just fine a few days ago and no changes have been made to any Stripe or .ENV code. I'm perplexed.
Other .ENV variables, such as database connection parameters, all seem fine. Only Stripe is effected.
I have checked the .ENV file. I have cleared cache (php artisan cache:clear). No difference. I don't know where to go from here. Any suggestions...?
So, after days of chasing ghost solutions a simple artisan config:clear solved the issue. The glitch was on the Forge/Digital Ocean end, not my code. I had already tried artisan cache:clear thinking that would resolve what (correctly) appeared to be a caching issue, but I was using the wrong artisan cache clearing command. All good now and back working again :)
I am setting up a Laravel 5 openshift application but every time i had the database code in project it says whoops something missing. I have added the environment in .env as in my database credential an still no success. I am wondering what may be the cause of this since I followed all instruction the website is working but only if I omit my database code.
Are you trying to get your database working for local or remote development? The .env file in the root directory is for local development, while the .openshift/.env file is for remote development. If you're using an standard OpenShift database (such as MySQL or PostgreSQL), you shouldn't need to make any configuration changes to get the database working. It's already configured via environment variables.
I built my site on my local machine on MAMP and I migrated the finished site to my remote server. I used Akeeba Backup and Kickstart and installed before making the final back up and then setting it up on the remote server.
However after doing so, I am no longer able to login to my admin. The passwords have not changed and the only thing I get is a yellow pop up message above the login box that says "Warning".
I reset my passwords several times but no success. The site works without a hitch so I don't think something went wrong on the migration but that wouldn't explain why I no longer can't log into my local instance.
I am a little perplexed. I am not sure if there is a bug with Akeeba Kickstart 3.9.
Most probably your remote server has the newer PHP version. The reason is that new PHP version generates the MD5 in a different way.
I also had the same issue once ... please try the following steps...
in you DB's Joomla user table
Backup the password'hash of your desired user.
Now go to this site and get the new MD5 hash of your password.
INSERT the new MD5 hash into DB.
Now try logging in again.
I found my issue even though my local MAMP was using PHP 5.3 and my remote server PHP 5.6 the actual problem was that for some reason the Joomla User plug in was disabled during the migration which caused me not being able to log in.
I went into my DB and set the flag from '0' to '1' and it resolved the issue. I am not sure how the parameter was changed but it was the culprit.
I'm using Joomfish component then it give error "500 not valid database" For my Component.
When I changed my database MySQL to mysqli then it's working fine.
Why?
Unless you are running PHP 5.3, the mysqli extension is not installed by default. You probably haven't installed it, or it isn't configures properly.
Please check the phpinfo() function to see if it is installed and read about setting up mysqli to see how to install and/or configure it.