PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, February 16, 2022

[FIXED] disable symfony 5 database connection

 February 16, 2022     doctrine, php, symfony, symfony5     No comments   

Issue

I have the default config in my symfonu project I have this line at .env file

DATABASE_URL="postgresql://db_user:db_password@127.0.0.1:5432/db_name?serverVersion=13&charset=utf8"

and I get this error

An exception occurred in driver: SQLSTATE[08006] [7] could not connect to server: Connection refused
Is the server running on host "127.0.0.1" and accepting
TCP/IP connections on port 5432?

Of course I dont have not isntalled postgres, and I dont need a database for this project, How I cant fix this error I tried to comment the .env file line but I get another error


Solution

Commenting the line as L3xpert answer suggests doesn't seem to do the job.
It will throw the error :
Environment variable not found: "DATABASE_URL".

If you don't need Doctrine but you have Website-Skeleton installed, you can remove Doctrine by running this command :

composer remove doctrine/doctrine-bundle doctrine/doctrine-migrations-bundle


Answered By - jhice
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing