php have a easy way to run a light server:
first cd into php file directory, then

php -S 127.0.0.1:8000

then you can run php

Answer from peter zhang on Stack Overflow
🌐
Sololearn
sololearn.com › en › Discuss › 221852 › how-should-i-run-php-files-in-google-chrome-
How should i run .php files in Google Chrome?? | Sololearn: Learn to code for FREE!
either run in local server or host it. for local server you can use xampp, for other platforms similar local server are available. install and run your php. ... don't open the files from folders directly, instead, COPY this link to chrome ...
🌐
Quora
quora.com › How-can-you-view-PHP-files-using-a-web-browser-like-Chrome-or-Firefox
How to view PHP files using a web browser like Chrome or Firefox - Quora
To view PHP files in a web browser (Chrome, Firefox, Edge, Safari), you must run them through a PHP-capable web server or otherwise execute the PHP engine. Browsers only render the resulting HTML/CSS/JS that PHP produces; they cannot run PHP ...
Discussions

run php in chrome - Google Chrome Community
Skip to main content · Google Chrome Help · Sign in · Google Help · Help Center · Community · Google Chrome · Privacy Policy · Terms of Service · Submit feedback · Send feedback on... This help content & information · General Help Center experience · More on support.google.com
🌐 support.google.com
February 25, 2019
How can i run php in my browser
There also is a portable version that runs from a USB stick (or local drive if you want): https://portableapps.com/apps/development/xampp · The package is easy to install and configure and you can simply drop your PHP files in the folder for the HTML files and then view them in your browser. More on reddit.com
🌐 r/learnprogramming
6
0
February 17, 2021
PHP file not working on my chrome browser, or in my html files - Stack Overflow
I only use chromebook, and I can't download any extra browsers or .exe files. ... you can buy some cheap hosting and you can use that to test so you won't have to install anything locally. You can't include php code in a file with the .html extension. You can combine php with html but you have to do it in a file with the extension .php ... You can't directly add most of the websites using iframe. PHP files can't run ... More on stackoverflow.com
🌐 stackoverflow.com
"Open with Chrome" showing code instead of webpage
Chrome doesn’t run PHP. Your Webserver does. When accessing a PHP file with a double-click/„Open with“ in a browser, it will render as plain HTML, the PHP doesn’t get executed. You need a Webserver like Apache/Nginx that processes the PHP files for you, on windows you usually use Xampp, and then access your website via a http URL via localhost Watch your address bar. Wrong: file:///c/some/path/index.php Right: http://localhost/some/path/index.php More on reddit.com
🌐 r/PHPhelp
11
1
March 18, 2018
🌐
YouTube
youtube.com › watch
How to Run PHP on VSCODE | How to Run PHP Code on Chrome | PHP Code Not Running in xampp - YouTube
How to Run PHP on VSCODE | How to Run PHP Code on Chrome | PHP Code Not Running in xampp #xamppserver #phpcode #vscode #localhost #phpscripts In this video...
Published   March 21, 2022
🌐
Maschituts
maschituts.com › how-to-run-a-php-file-in-chrome
How to run a PHP file in Chrome in 2023
May 8, 2022 - If necessary, you can view the ... to ensure they work as you need. As you have learned, running a PHP file directly in the Chrome browser is not possible....
🌐
Google Support
support.google.com › chrome › thread › 1866585 › run-php-in-chrome
run php in chrome - Google Chrome Community
February 25, 2019 - Skip to main content · Google Chrome Help · Sign in · Google Help · Help Center · Community · Google Chrome · Privacy Policy · Terms of Service · Submit feedback · Send feedback on... This help content & information · General Help Center experience ·
🌐
Reddit
reddit.com › r/learnprogramming › how can i run php in my browser
r/learnprogramming on Reddit: How can i run php in my browser
February 17, 2021 - A subreddit for all questions related ... be posted and votes cannot be cast. Share ... PHP is a server side language, it doesn't run in the browser like JS for example....
🌐
YouTube
youtube.com › watch
How to Run PHP File in Browser? (2025) - YouTube
🚀 How to Run a PHP File in Browser – Quick & Easy Guide for BeginnersWant to run a PHP file in your browser but not sure how? In this step-by-step tutorial,...
Published   February 16, 2025
Find elsewhere
🌐
Ask Ubuntu
askubuntu.com › questions › 767635 › run-php-file-in-browser-from-command-line
apache2 - Run php File in Browser from Command Line - Ask Ubuntu
May 4, 2016 - As for any PHP file, opening the ... you would get the same result by opening the file from the GUI. You need to request the page to the server, i.e. in your case localhost: ... Where path/to/myfile.php is the relative path ...
🌐
Medium
alinawrites.medium.com › how-to-run-php-file-on-localhost-e740890fcdff
How To Run PHP File On Localhost. Most articles and tutorials are written… | by Alina Writes | Medium
November 2, 2022 - 0:08 Make sure XAmpp server is installed and already running on your PC · 0:30 Go to C:\xampp\htdocs folder (Xampp’s localhost root folder) 1:05 Open index.php file you just created in VSCode (Visual Studio Code) 1:54 Open PHP script file in Chrome browser running on localhost
🌐
Reddit
reddit.com › r/phphelp › "open with chrome" showing code instead of webpage
r/PHPhelp on Reddit: "Open with Chrome" showing code instead of webpage
March 18, 2018 -

https://imgur.com/a/VwimI (Image)

So the way I got this error was I was trying to configure this to work with my code editor by right clicking the .php file > open with > selecting my Sublime Text. I decided to do the same thing now but make it open with Google Chrome with right click > open with > selected Google Chrome.

Before I messed with it doing the above ^ I was able to click the .php file which showed a Google Chrome icon and it would load my page properly with whatever I coded.

The error I have now is that when I click on my .php file (again showing a chrome icon) it opens Chrome but instead of properly displaying the code running (it should show a simple phpinfo() display) it instead shows the raw code rather than processing the code and displaying that. I'm a newb and I hope this makes sense to someone.

What I want:

I want to be able to click on a .php file that is meant to open with Chrome and for it to open and display the processed .php code as a web page rather than displaying raw code. I believe I screwed this up by using right click > open with > and selecting something other than defaults.

Is there a way to restore this? I am new and confused.

Currently following along with a Udemy course.

🌐
YouTube
youtube.com › watch
PHP Tutorial For Beginners | How to run PHP Program in Browser - YouTube
PHP Tutorial For Beginners | How to run PHP Program in BrowserXampp Download Link : https://www.apachefriends.org/download.htmlVisual Studio Code Download L...
Published   June 8, 2019
🌐
Quora
quora.com › How-do-I-open-a-PHP-file-in-a-browser
How to open a PHP file in a browser - Quora
Answer (1 of 11): You don’t. Browsers interpret HTML, CSS and JavaScript. PHP is interpretted “server-side”. Quotes used as you can; however, install a local server with XAMPP, MAMP, or WAMP, depending on your OS and preference. If your OS is linux, you could look into installing a LAMP stack.
🌐
Visual Studio Marketplace
marketplace.visualstudio.com › items
Open PHP/HTML/JS In Browser - Visual Studio Marketplace
Extension for Visual Studio Code - A GUI to open PHP/HTML/JS files in browser on http://localhost or file:/// scheme. Suitable for XAMPP.
🌐
GeeksforGeeks
geeksforgeeks.org › installation guide › how-to-run-php-file-in-chromebook
How to Run PHP File in Chromebook? - GeeksforGeeks
March 21, 2022 - First and most important, we need to install Linux Terminal in Chromebook. It is the command prompt of the Chromebook. Similar to the Linux terminal. And we need to install Apache in it. Apache will help PHP codes run on the server. Then we can proceed with it. ... PHP helps us to run HTML & PHP files easily.
🌐
YouTube
youtube.com › realtoughcandy
How to Run PHP File in Localhost Xampp | how to open php ...
🔥 💻 📚 Escape tutorial hell! Level up, land a job and get a raise (start today): https://www.realtoughcandy.io This was one of the first questions I had as an...
Published   March 10, 2023
Views   131K