Home >> FAQs/Tutorials >> PHP Script Tutorials and Tips >> Index

PHP Script Tips - Downloading and Installing PHP

By: FYICenter.com

A collection of 4 tips on PHP installation:

  1. How To Download and Install PHP for Windows?
  2. How To Check Your PHP Installation?
  3. Where Are PHP Configuration Settings Stored?
  4. How To Run a PHP Script?

How To Download and Install PHP for Windows?

The best way to download and install PHP on Windows systems is to:

  • Go to http://www.php.net, which is the official Web site for PHP.
  • Download PHP binary version for Windows in ZIP format.
  • Unzip the downloaded file into a directory.

You are done. No need to run any install program.

How To Check Your PHP Installation?

PHP provides two execution interfaces: Command Line Interface (CLI) and Common Gateway Interface (CGI). If PHP is installed in the \php directory on your system, you can try this to check your installation:

  • Run "\php\php -v" command to check the Command Line Interface (CLI).
  • Run "\php\php-cgi -v" command to check the Common Gateway Interface (CGI).

If you see PHP printing the version information on your screen for both commands, your installation is ok.

Where Are PHP Configuration Settings Stored?

PHP stores configuration settings in a file called php.ini in PHP home directory. You can open it with any text editor to your settings.

How To Run a PHP Script?

A standard alone PHP script can be executed directly with the PHP Command Line Interface (CLI). Write the following script in a file called hello.php:

<?php echo "Hello world!"; ?>

This script can be executed by CLI interface like this:

\php\php hello.php

You should see the "Hello world!" message printed on your screen.


Selected Developer Jobs:

More...