Visual Studio Code Xampp



  1. Visual Studio Code Xampp Php Debug
  2. Php.validate.executablepath Visual Studio Code Xampp
  3. Visual Studio Code Xampp
  4. Visual Studio Code Live Server Xampp

PHP in Visual Studio Code. Visual Studio Code is a great editor for PHP development. You get features like syntax highlighting and bracket matching, IntelliSense (code completion), and snippets out of the box and you can add more functionality through community-created VS Code extensions. VS Code uses the official PHP linter (php -l) for PHP language diagnostics. This allows VS Code to stay current. I want to connect xampp mysql to visual studio 2013.I've read many article's about that problem but any solution is not perfect for solve problem.In visual studio 2013 'choose data sourse' window don't have mysql database option for connect mysql.

To those who are using XAMPP, you can connect to the database through these steps:

Code
  1. Go to the xampp > apache > conf, then open httpd.conf using your editor.
  2. Search for 'Listen' and find the one that doesn't have a # before it. Change whatever number you have there to 3306. (i.e. Listen 3306)
  3. Search for 'ServerName localhost' and change the number to 3306 as well. (i.e. ServerName localhost:3306)
  4. Save and exit.
  5. Now type this in your editor:$db = new PDO('mysql:host=localhost;dbname=database;port=3306','root',');

Hope that works!

Dennis Amiel Domingo Great tip! Do you know if there is a way we can access Xampp directly through the code editor? I have Xampp and Visual Studio Code but would like to run everything from VSC if possible?

After some research I found a solution that worked for me.

Visual Studio Code Xampp Php Debug

  1. Download XAMPP
  2. Start mySQL in XAMPP, it should be on port 3306
  3. In Visual Studio Code download and enable the extension 'PHP Server' by baprifa (Ignore this step if you already have, or if are using a different php server. This is the one I happen to be using)
  4. In Visual Studio Code download and enable the extension 'MySQL - MySQL management tool' by Jun Han
  5. Reload Visual Studio Code to ensure it's activated.
  6. In the Visual Studio Code Explorer you will now notice a MYSQL drop down tab at the very bottom. There should be a localhost database in there. If it's not appearing or shows an error, open XAMPP again to make sure you started mySQL
  7. You should now be up and running. To upload the project to phpMyAdmin in XAMPP, open the database.sql file that was downloaded from treehouse for the project. Right click anywhere on the document, and select option that says 'Run MySQL Query'.
  8. You can verify you are connected by opening the XAMPP control panel, Start the Apache Server, Open Web Browser and type localhost
  9. It will bring you to XAMPP page hosted locally on your computer. From there click phpMyAdmin link. On the left hand side verify that your database was uploaded.

NOTE: in this exercise the teacher is using the SQLite (PDO) driver. Instead, you will need to use the MySQL (PDO) driver.

Php.validate.executablepath Visual Studio Code Xampp

To test that everything is working, in the inc folder, create a connection.php file. This is the code I used to test:

After saving it, right click and choose PHP Server: Serve Project to view. Bitpay exchange rate.

NOTE: If both the Apache Server in XAMPP, and PHP Server by baprifa in VS Code are running, the PHP Server will be the one that works. To use phpMyAdmin you must stop the PHP Server.. at least that's how it is on my system.

I hope this info is helpful. I am new to this, so if there is anyone with more experience who would like to add or correct anything I may have typed, please feel free to comment.

Thanks jaycode! Ip ping for mac. Unfortunately, I'm not that familiar with Visual Studio Code. You may wanna try this link: https://www.youtube.com/watch?v=eE6oxEhqqoU

Hope that helps!

Visual Studio Code Xampp

Thanks Dennis. I've seen this before. It's a good video but is for php debug. I would like to connect Visual Studio Code to phpMyAdmin (The one from Xampp) . I am not sure if this is possible.

Visual Studio Code Live Server Xampp

Posting to the forum is only allowed for members with active accounts.
Please sign in or sign up to post.