How to run Php Scripts using XAMPP.

A lot of you know that I can code in various languages but my very first internship was with using PHP.

I learned PHP in college and I ran scripts using XAMPP.

Here is more about PHP from the PHP manual.

https://www.php.net/manual/en/intro-whatis.php

PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML.

To run a PHP script using XAMPP, follow these steps:

  1. Install XAMPP on your computer.
  2. Start the Apache and MySQL modules in XAMPP.
  3. Save your PHP script in the “htdocs” folder inside the XAMPP installation directory. The file path should look like this: C:\xampp\htdocs\your-script.php
  4. In your web browser, enter the URL http://localhost/your-script.php to execute the script.

Alternatively, you can also run the script from the command line by using the PHP command-line interpreter. To do this, open the Command Prompt and navigate to the directory where the PHP script is located. Then enter the command php your-script.php.

Note: Make sure that the PHP extension is enabled in your XAMPP installation. If it’s not, you may need to edit the php.ini configuration file to enable it.

Here is youtube video on how to do it.

You can also practice MySQL when you have xampp and if you are in the security side of the house that test pages you can just copy the code from a page and test it locally.

Any way. This is all for now! TTYL Peace!

Categories: php