How do I install PHP on my computer

To install PHP on your computer, follow these steps:

  1. Visit the official PHP website at php.net/downloads.
  2. Choose the version of PHP you want to download. It's recommended to select the latest stable version.
  3. Download the appropriate binary package for your operating system.
  4. If you are using Windows, unzip the downloaded file to a directory of your choice (e.g., C:\php).
  5. Add the PHP directory to your system's PATH environment variable.
  6. Verify the installation by opening your command line interface and typing php -v. You should see the version information displayed.

Example of a simple PHP script:

<?php echo "Hello, World!"; ?>

This script outputs "Hello, World!" when run on a PHP server.


PHP installation install PHP PHP setup PHP download