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 Overflowrun php in chrome - Google Chrome Community
How can i run php in my browser
PHP file not working on my chrome browser, or in my html files - Stack Overflow
"Open with Chrome" showing code instead of webpage
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
You have to run a web server (e.g. Apache) and browse to your localhost, mostly likely on port 80.
What you really ought to do is install an all-in-one package like XAMPP, it bundles Apache, MySQL PHP, and Perl (if you were so inclined) as well as a few other tools that work with Apache and MySQL - plus it's cross platform (that's what the 'X' in 'XAMPP' stands for).
Once you install XAMPP (and there is an installer, so it shouldn't be hard) open up the control panel for XAMPP and then click the "Start" button next to Apache - note that on applications that require a database, you'll also need to start MySQL (and you'll be able to interface with it through phpMyAdmin). Once you've started Apache, you can browse to http://localhost.
Again, regardless of whether or not you choose XAMPP (which I would recommend), you should just have to start Apache.
You do not need a web server to execute PHP script unless you need to run it using a browser. Install PHP in your operating system and include PHP path in your environment path or variable (depending on what OS) you are using. If you are just using the script for the mailing stuff from your own computer, you don't need a web server like apache, you just need PHP and its cli program installed and you be run php scripts directly. Google the web how on how run PHP command line. Or visit this official documentation link: http://php.net/manual/en/features.commandline.php
You need to download a server, and install it. If you want to go to the trouble, you can get XAMPP, and once it's installed, move the PHP file to the root of your installation (usually c:\xampp\htdocs\ on windows) and then use the url localhost/script.php in your browser.
You can't directly add most of the websites using iframe. PHP files can't run directly on a web browser like HTML files, you have to use a server like Xampp.
Browsers only understand html, css (for markup and display) and javascript (for logic execution on the rendered (displayed) html view). Therefore, whichever framework you may use (like php) to serve any kind of content on browser, it should eventually send the content in html format to be displayed properly. (Other content types such as - image, video, file etc. are handled differently.)
For the iframe part, as others have stated in their answers, you cannot just embed any website on the internet in your own using the iframe tag. Browsers respect many response headers sent by websites, including the X-Frame-Options, which, if present in the website's response with deny as value, instructs any browser to disallow the content from that website to be served in an iframe. There are many other supported values for this header, and many other such headers have been standardized under Content security policy concept of the web.
So, it has most likely nothing to do with your Chromebook, if you're using the normal browsers.
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.