Security, Privacy, AI and CSR information for all Piano products now lives in one place. Explore our Compliance Center.
Audience
English French
English French

How to Test PHP Code Locally

Serving the "Hello World!" PHP script using XAMPP

  1. Download the XAMPP installer from Apache Friends

  2. Install XAMPP to C:\xampp

  3. Create a new directory, php-test, under C:\xampp\htdocs

  4. Save this PHP script as C:\xampp\htdocs\php-test\helloWorld.php

    <!DOCTYPE html>
    <html>
        <head>
            <title>Hello World!</title>
        </head>
        <body>
            <?php 
                print "<h2>Hello World!</h2>";   
            ?>
        </body>
    </html>
    
  5. Open the XAMPP Control Panel and start Apache (see red circle below)

  6. image-20211217-091819.png
  7. If another app uses port 443 (for example, Skype), you'll see an error (red text above). Close that app and restart Apache.

  8. Open http://localhost/php-test/helloWorld.php

image-20211217-091853.png


Last updated: