PHP on local machine without apache

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

Bogdan_Floares

New Member
Oct 8, 2021
3
0
1
PHP:
<html>
    <head>
        <title>test</title>
    </head>
    <body>
        This is html part<br>

<?php
    $text = "echo from php";
    echo $text;
    
?>
    </body>
</html>
I used to create simple php and mysql stuff on apache localhost using xampp. Then I bought an website and experiment there with mysql and php. Now I have no logner that site and I was wandering is there any way to run php on my local machine without any type of server thing like apache, just like I create a .html file and I open it on browser with file://path. Instead of this to create a .php file like this and run on browser as a file:// without localhost or server?
 

RTM

Well-Known Member
Jan 26, 2014
956
359
63
You could also spin up a VM (using Virtualbox or whatever you may have) with something like Turnkeylinux's LAMP image:

That'll give you an environment that is fairly close to what would probably be production on most hosting providers.