Local php setup not showing my output correctly

Matthew B 0 Reputation points
2025-02-07T22:03:25.37+00:00

I am trying to run a local instance of PHP to follow along with the Get Started with PHP videos on LinkedIn. I downloaded the PHP for Visual Studio Code 2022 extension, but am only getting a Hello World output in my browser when that isn't what I have in my test file. What should I check>

Visual Studio Training
Visual Studio Training
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Training: Instruction to develop new skills.
33 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Pradeep M 6,240 Reputation points Microsoft Vendor
    2025-02-10T03:56:28.4366667+00:00

    Hi Matthew B,

    Thank you for reaching out to Microsoft Q & A forum. 

    1.Make sure you are editing and saving the correct PHP file before refreshing your browser. 

    2.Start a local PHP server by running php -S localhost:8000 in the terminal and visit http://localhost:8000/yourfile.php

    3.Clear your browser cache by using Ctrl + Shift + R  or try opening the page in incognito mode. 

    4.Check if PHP is installed by running php -v in the terminal. If it’s not installed, you may need to set it up. 

    5.Confirm that PHP is processing by adding <?php phpinfo(); ?> to your file,if nothing appears, your setup may be incorrect. 

    Please feel free to contact us if you have any additional questions.     

    If you have found the answer provided to be helpful, please click on the "Accept answer/Upvote" button so that it is useful for other members in the Microsoft Q&A community.  

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.