I have deployed my project on my webserver. The .env contains the right settings for the web database but for some reason Laravel still try to connect to localhost.
The problem is that if I use any of the php artisan xxx:clear, it gives the same error:
SQLSTATE[HY000] [1698] Access denied for user 'root'#'localhost' ...
So I can I force Laravel 8 to clear the cache (as I guess this is the problem) and read the correct credentials in the .env file?
hey you can use these commands
php artisan config:cache
php artisan config:clear
php artisan cache:clear
thanks :)
The Optimize command still works like champ Try
php artisan optimize
It will clear
Configuration cache
Route cache
Files cache
Related
I'm using mcamara/laravel-localization. I need to get languages from db instead of laravellocalization config file. Any ideas how to do that. I would be so grateful.
Your best option is to use the laravel translation loader:
Install Laravel translation loader through Composer:
composer require spatie/laravel-translation-loader
Then publish Laravel translation loader migration file:
php artisan vendor:publish --provider="Spatie\TranslationLoader\TranslationServiceProvider" --tag="migrations"
Finally, run the migrations; it will create a new table called language_lines in the database:
php artisan migrate
UPDATE: for laravel 6+ see the Issue # github
source: Laravel news
I'm new to CakePHP and my employer asked me to move our CakePHP app from a dedicated server to another server (for testing purposes). I've copied all the files, changed app's database.php config but I'm getting a ERR_TOO_MANY_REDIRECTS when accessing the app on the new server.
I did not work on the app so I don't know much about it, but I have all the files.
LE: So, I've uploaded the app on a fresh install of CakePHP. I now have 3 .htaccess files, CakePHP says it's working, but when I try to upload DebugKit (following the install notes & having the proper version for CakePHP 2.4.3.) I get the ERR_TOO_MANY_REDIRECTS.
A look in Chrome's console shows me this. If I delete the DebugKit altogether, the page looks like this & it also has the footer from the app.
The new structure of the app is the standard one.
Please advise!
Best guess is the (apache?) DocumentRoot setting may be clashing with your APP config on the new server and/or the PHP settings. Have you checked your php.ini on the new server? What's the output of phpinfo() ? Once fixed HIGHLY RECOMMEND check other environment variables by turning on the DEBUG flag in config/app.php For your version try pr(Debugger::trace()); or even better for dev. install the Debug kit. Anyway, DocumentRoot should be set to webroot (assuming default install and directory structure).
I have a problem updating wordpress or installing wordpress plugin in my local version of google app engine. I get the following message.
Downloading install package from
https://downloads.wordpress.org/plugin/event-espresso-decaf.4.8.38.decaf.zip…
Unpacking the package…
Could not create directory.
With the same code base I am able install plugin using MAMP (Macintosh, Apache, MySQL, and PHP). However fails with google Pyton script (dev_appserver.py).
I tried changing the permission of the file system by giving privilege to all user for write. Tried executing as sudo dev_appserver.py .. Followed the advice in other post, No luck.
Whats the problem here?, With MAMP all looks good in my local, but the same code break as I deploy to GAE (appcfg.py -A APP-ID update app.yaml). Whats the problem here
Cannot write to file on Google App Engine Dev server with PHP?
Staring SDK 1.9.18, dev_appserver disables local file writing by default to better simulate the production environment. You can enable file writing by adding "google_app_engine.disable_readonly_filesystem=1" to your php.ini file.
I also wrote a blog post about running WordPress on App Engine flexible environment at:
https://wp.gaeflex.ninja/2016/03/25/using-wordpress-multisite/
Please give it a try too.
I'm trying to do some cakePHP development using my existing homestead
installation I use for Laravel.
I can get the application running but it says that
'URL rewriting is not properly configured on your server.'
I tried to use the instructions to configure nginx but did not have much luck.
Has anyone gotten url rewriting to work, or can point me at any sources?
I know their is a vagrant setup for cakephp, but I'd rather continue to use homestead if possible.
SSH into your Homestead VM.
Edit /etc/nginx/sites-available/your-site.app and add /webroot to the line that looks like: root "/home/vagrant/your-site"; so that it looks like root "/home/vagrant/your-site/webroot";
Restart nginx with: sudo service nginx restart
Your should find your CakePHP pages can find their static content.
I don't know much about homestead, other than it is a vagrant box. I would suggest using a box that was tailored for cakephp:
https://github.com/FriendsOfCake/vagrant-chef
This is an article on how to get that set up correctly:
http://josediazgonzalez.com/2014/12/02/designing-a-store-application-in-cakephp/
I have apache, php, and Mysql installed on my computer. I have added the PHP directory and C:\Apache\htdocs\cake\cake\console to my environmental variables path. When i load the path to the console on my CLI it loads cake.php then i type cake bake and it asks me for the path of my app, then database config. Now instead o f it loading the DMVC... menu it just returns to set the path and database and its like a loop. not sure what i am doing wrong.
All help appreciated
Thanks
Joe
Try cd'ing to your app's directory, and then run ../cake/console/cake bake
Try editing your path to C:\wamp\bin\php\php5.4.3; (I used the Wamp server, that's why mine is like that).