Like Us Like Us Facebook Subscribe Subscribe us YouTube Whatsapp Share us Whatsapp Query Send your queries

PHP Introduction and Environment Setup

PHP Introduction and Environment Setup

PHP (Hypertext Pre Processor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. The goal of the language is to allow web developers to write dynamically generated pages quickly. It is powerful enough to be at the core of the biggest blogging system on the web (WordPress , 25% of Web is powered by WordPress now)!

php

Requirement to Learn PHP :

Before you continue you should have a basic understanding of the following:

  • HTML
  • CSS
  • JavaScript

What is a PHP File?

  • PHP files can contain text, HTML, CSS, JavaScript, and PHP code
  • PHP code are executed on the server, and the result is returned to the browser as plain HTML
  • PHP files have extension “.php”

Environment Setup to Run PHP

  • install a web server (Apache, NGINX, IIS)
  • install PHP
  • install a database, such as MySQL(or SQLite,Postgres,Oracle,Access,Firebird …) and phpmyadmin

Better Install Cross-Platform Xampp(run on Linux,mac and Windows) or install wampp for windows, mamp for Mac or lampp for Linux.

As you know that if you work with WAMP Server then .php file will save in your own project directory in root like WWW . If you work with XAMPP  Server then .php file will save in your project directory in htdocs. Now we will create a program which will produce some output on browser. So copy and save in a file with .php extension and Run it.

Create a File welcome.php in root folder (We are using xampp means in htdocs folder) with code given below.

<?php
echo “WELCOME”;
echo ”PHP PROGRAM”;
?>

Now Access it by http://localhost/welcome.php (After running Xampp)

Output:

WELCOME PHP PROGRAM

5 1 vote
Article Rating
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

3 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

[…] PHP Introduction and Environment Setup […]

Sammy

If you are macOS user, ServBay.dev is a good tool, especially for the beginners. It handles all PHP, MariaDB, PostgreSQL versions, plus redis and memcached. Run multiple PHP instances simultaneously and switch easily. This tool has made my PHP dev simpler. Worth a shot!