0

I am running PHP Server and Live Server extension on Vscode on my Windows machine. I am trying to open a .php file in my browser so I can easily see front-end changes.

However, this is what I see:

Php page:

Error:

This is the error:

Database connection failed: SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it

These are my settings in PHP server extension:

settings

And these are my settings in the Live Server Chrome extension:

What could possibly be wrong?

I have xampp installed, the plugins installed, entered the settings as seen above, but it somehow doesnt show me the php page that I am trying to open.

2
  • The actual error seems to have nothing whatsoever to do with VS Code or Live server or even really PHP. Either you've put the wrong info about your database server in your code where you're trying to connect to it, or your database server isn't running. Did you google this error at all? I'm not sure what led you to associate this error with anything about VS Code extensons. Commented Nov 28, 2024 at 10:30
  • "SQL" in the error message should hint you that this problems is unrelated to VS code but related to MySQL. You have to check your "Live server" documentation on how to enable mysql Commented Nov 28, 2024 at 10:31

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.