freeCodeCamp/guide/english/php/php-install/index.md

2.7 KiB

title
PHP Install

What Do I Need for Installation?

Any computer! PHP is very versatile and can run in many different environments.

Manual Install:

Windows

  1. Download the zip from windows.php.net/download and unzip it (ex C:\PHP)
  2. Add php to the windows PATH (for example append ;C:\PHP)
  3. Copy and rename either php.ini - development or php.ini - production to php.ini

If you are using IIS for your webserver, this is a good resource:

MacOS

Type the commands in a terminal

  1. Install homebrew /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  2. Install php brew install php

Linux

This varies a bit with each distribution

  • debian/ubuntu sudo apt-get install php -y
  • fedora/rhl/centos dnf install php php-common

There are many good resources for this, like:

Install Bundles

There are also several popular install bundles for PHP technology stacks which are multi-platform.

Find a webhost with free PHP services.

It is common for free webhosting services to offer support for PHP.

Once PHP is installed:

If you installed PHP with a webserver, often a default route is set for localhost/info.php or 127.0.0.1/info.php. If PHP has been integrated properly, it should display a description of the current PHP installation. If your server will be public, you should delete info.php as it contains private details about your installation, system.

If you did not install PHP with a webserver, several tools integrate well with the library for the ability to locally run, debug, host your PHP scripts and applications. VS Code's extension PHP Server allows your to develop and host locally.

Resources