Skip to content

Troubleshoot

Armin edited this page Jan 21, 2021 · 22 revisions

Setup without Docker

❗ Keep in mind that settings in the .env file are only read on start. You may need to restart your application and clear the configuration cache

php artisan config:clear & php artisan config:cache & php artisan serve

  • Problem: net::ERR_CONNECTION_REFUSED If you want to deploy your application without Docker or vice versa you´ll notice that the APP_URL key uses port :8000 without Docker and no port option with Docker. This is because the Docker container uses another port internally and refuses the connection on the default port - which is 8000.

Solution

  1. Make sure to use the .env.example.without_docker
  2. php artisan config:clear
  3. php artisan config:cache
  4. npm install
  5. composer install
  6. npm run watch will compile your Vue components into raw javascript and overwrite the cached app.js (where the other port may be specified at this point and causes the error)
  7. php artisan serve
  • Problem: SQLSTATE[HY000] [2002] Could not connect because the target computer refused to connect (SQL: select * from information_schema.tables where table_schema = conform and table_name = migrations and table_type = 'BASE TABLE')

Solution:

  1. Check if XAMPP is running correctly
  2. Check your .env file if your database credentials are correct
  3. Log in into phpmyadmin and make sure that a database with the corresponding name exists

xampp-control-panel

Docker

❗ Keep in mind that settings in the .env file are only read on start. You may need to restart your docker containers

docker-compose down & docker-compose up -d

  • Problem: RuntimeException: No supported encrypter found. The cipher and / or key length are invalid.

Solution:

Run php artisan key:generate to update APP_KEY on .env, then restart the container docker-compose restart

  • Problem: Changes to .env file apparently ignored by laravel

Solution:

Restart cluster. Settings in the .env file are only read on start: docker-compose restart

  • Restarting the Docker daemon should resolve most of the issues. If it´s not try the following:

Put down XAMPP and everything that is not for Docker, then restart the Docker daemon in your Windows control panel. After that bring up the containers with docker-compose up -d

  • Problem: wait-for-it.sh script detected wrong line endings:

In pycharm you can quickly change the line endings by clicking on the letters CRLF at the bottom right of the screen and selecting LF. It is always recommended to use LF over CRLF.

script-lf-line-endings

Found on Stackoverflow

Clone this wiki locally