VSCode Setting Up Live Server for PHP - 2
VSCode Setting Up Live Server for PHP - 2

VSCode: Setting Up Live Server for PHP1 min read

  Reading time 1 minute

The Live Server extension for Visual Studio Code is widely known among developers. While it’s primarily designed for static webpages like HTML, it can also handle dynamic webpages, including PHP, Node.js, and ASP.NET.

Here’s how you can set up Live Server to work with both static and dynamic webpages:

1. Install Required Extensions:

Download and install PHP Server and Live Server from the Visual Studio Code Marketplace.

2. Prepare Your PHP File

Create a PHP file, such as index.php
Place it in a sub-directory under /var/www/html/ (e.g., /var/www/html/demo/)

3. Install Live Server Chrome Extension:

VSCode Setting Up Live Server for PHP - 1

Add the Live Server Chrome extension to your browser.
Customize its settings as per your requirements.
(Attach relevant screenshots if necessary.)

4. Start Live Server in VSCode:

VSCode Setting Up Live Server for PHP - 2

Click the “Go Live” button located in the bottom-right corner of the Visual Studio Code interface.
(Attach a screenshot for clarity.)

5. Open Your PHP File in VSCode:

VSCode Setting Up Live Server for PHP - 3

Open the index.php file in Visual Studio Code.
Right-click on the file, then:Select ‘PHP Server: Reload Server’.
Choose ‘PHP Server: Open file in browser’.
(Include a context menu screenshot for better understanding.)

6. Access Your Webpage:

VSCode Setting Up Live Server for PHP - 4

Open your browser and navigate to http://localhost:3000/demo/index.php.

You can now use Live Server seamlessly for both static and dynamic websites!

Show 14 Comments

14 Comments

  1. Somebody necessarily help to make critically articles I’d state.

    This is the first time I frequented your web page and so far?
    I surprised with the research you made to make this particular submit extraordinary.
    Excellent job!

  2. Good way of describing, and good article to take facts concerning my presentation focus, which i
    am going to deliver in college.

  3. I found this article very helpful. Since we work
    deeply with Python backend solutions, we really appreciate the technical depth you’ve provided here.

    Bookmarked this for later.

  4. It’s awesome to pay a visit this web page and reading the
    views of all colleagues regarding this post, while I am also keen of getting know-how.

  5. great put up, very informative. I wonder why the opposite specialists of this sector
    do not notice this. You should proceed your writing. I am confident, you
    hwve a great readers’base already!

  6. I’m not sure where you are getting your information, but good
    topic. I needs to spend some time learning much
    more or understanding more. Thanks for great information I was looking for this information for my mission.

  7. That is a good tip particularly to those new to the blogosphere.
    Short but very precise information… Thank you for sharing this one.
    A must read article!

  8. This is very attention-grabbing, You are an overly professional blogger.
    I have joined your rss feed and look forward to searching for extra of
    your wonderful post. Additionally, I’ve shared your web site in my social networks

  9. It’s great that you are getting ideas from this post as well as from our discussion made at this time.

  10. This is very interesting, You are a very skilled blogger.
    I’ve joined your feed and look forward to seeking more of your excellent post.
    Also, I have shared your website in my social networks!

  11. That is a good tip particularly to those new to the blogosphere.
    Short but very precise information… Thank you for sharing this one.
    A must read article!

  12. This blog was… how do I say it? Relevant!! Finally I’ve found something
    which helped me. Thanks!

  13. I am sure this article has touched all the internet
    users, its really really fastidious piece of writing on building up
    new web site.

  14. I’m impressed, I have to admit. Rarely do I come across a
    blog that’s both educative and engaging, and let
    me tell you, you’ve hit the nail on the head. The problem is something
    that not enough men and women are speaking intelligently about.
    Now i’m very happy I came across this in my search for something regarding this.

Leave a Reply

Your email address will not be published. Required fields are marked *