No connection could be made because the target machine actively refused it. [tcp://127.0.0.1:6037] - laravel

No connection could be made because the target machine actively refused it. [tcp://127.0.0.1:6037] (View: C:\laragon\www\Project CRM\resources\views\users\index.blade.php)
keep getting the error in my laravel project , it only appears in my specific module of users and when i login with the user credentials , otherwise it does not affect my other modules of the code
my env file is
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=daybyday
DB_USERNAME=root
DB_PASSWORD=
BROADCAST_DRIVER=log
CACHE_DRIVER=file
FILESYSTEM_DRIVER=local
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120
MEMCACHED_HOST=127.0.0.1
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6037
any idea what is causing this error ?
thanks in advance

The redis server was not started and the port number was wrong in my env file

Related

How to Connect to Database SQLSTATE[HY000] [1045] Access denied for user 'root'#'localhost' (using password: YES)

I got this error when i tried to connect to my database:
SQLSTATE[HY000] [1045] Access denied for user 'root'#'localhost' (using password: YES) (SQL: select active_template from general_settings limit 1)
I'm new to laravel so i'm sorry if it's a common question because i try to find the solution and see similar problems but not exactly the same.
I tried to change my .env files and use no pass for the db and restart the server but it is still getting the same error. Here's what my env files look like:
APP_NAME=Laravel
APP_ENV=production
APP_KEY=base64:xxx
APP_DEBUG=true
APP_URL=http://localhost
LOG_CHANNEL=stack
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=database123
DB_USERNAME=root
DB_PASSWORD=
BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
what should i do? thankyou
Try to make another MySQL user, and grant all privileges to ONLY that database. Mostly root user is denied from shared hosting since i check your APP_ENV is on production.
Hope this helpful
https://phoenixnap.com/kb/how-to-create-new-mysql-user-account-grant-privileges
try php artisan config:cache and php artisan cache:clear after changing your .env file

links will not work on laravel app with azure server

Hey folks any advice would be so helpful. My first time deploying to azure. The app deploys nice and slick, but i find that my app opens to the index page, but will not link to any others.
"The resource you are looking for has been removed, had its name changed, or is temporarily unavailable."
s
The path is set to public in the application settings
i have scaled up the ressources, added a web-config file then removed it again, the app functions with local host... I'm sure this is not the first time this has been an issue... Thanks
.env file
APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:ymq4IuQRQdVHqcamf8wMfuqo1IwbpVTcZZrBZ3CnEyo=
APP_DEBUG=true
APP_URL=http://jobquest1030.scm.azurewebsites.net
LOG_CHANNEL=stack
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=joboard
DB_USERNAME=root
DB_PASSWORD=
BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

Things to ensure when deploy new laravel 5 project to VPS server

I have just finished my Laravel development (with some jquery / javascript) project and I am preparing to officially launch the website with vps servier. For the smooth running and security of the website, I only know how to handle some things in the .env file like blow:
Besides this configuration, are there any other things I have handle it before launching the website officially?
.env
APP_NAME=MyProject
APP_ENV=production
APP_KEY=base64:u93RlbQ5zcs.............
APP_DEBUG=false
APP_LOG_LEVEL=debug
APP_URL=http://mydomain
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=mydbname
DB_USERNAME=myuser
DB_PASSWORD=*******************
BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=465
MAIL_USERNAME=info#mydomain.com
MAIL_PASSWORD=*******************
MAIL_ENCRYPTION=SSL
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
It seems OK, i have seen similar .env files running on various production servers.

Laravel 5.3 production gey generate error failed to open stream

I've copied the example .env file on production server and made a .env with the following info (IP is fake numbers). I get an error when generating the app key saying PHP Warning: require(/var/www/laravel/bootstrap/../vendor/autoload.php): failed to open stream: No such file etc.
APP_ENV=production
APP_KEY=
APP_DEBUG=false
APP_LOG_LEVEL=error
APP_URL=http://108.99.999.99
DB_CONNECTION=mysql
DB_HOST=108.99.999.99
DB_PORT=3306
DB_DATABASE=npr
DB_USERNAME=root
DB_PASSWORD=mypasswordhere
BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_ENCRYPTION=null
PUSHER_APP_ID=
PUSHER_KEY=
PUSHER_SECRET=
You need to run composer install or composer dump-autoload.
As you don't have autoload.php file which is generated by composer.

DB_HOST and Browser Settings For Laravel App

I'm putting together a Laravel 5.2 application and using Homestead with it. When I need to migrate my database these are the settings that I have set up that allows me to do migrate. However if I want to use these in my browswer then I have to switch 127.0.0.1 to localhost. Why do I have to do this and how do I fix that?
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=33060
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
Anybody have any ideas on this?
if you are using wamp do like this:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=33060
DB_DATABASE=mysql
DB_USERNAME=root
DB_PASSWORD=
mysql is your database .you can access it by going localhost/phpmyadmin
I was able to find out that I need to keep it as DB_PORT=3306 and only use 33060 for when I'm trying to access the database with a program like Sequel Pro.

Resources