Web Server PHP
practically works with almost all types of web servers. If your web host supports PHP, the server will automatically parse the scripts placed in your web directory. You can turn your computer into a web server by installing a web server program. The most commonly used is the Apache server. You can download it for free at this website: https://httpd.apache.org/download.cgi. Database
Virtually any type of database software can be used with PHP. This includes Sybase, Oracle, and MySQL. The most popular open-source RDBMS today is MySQL. For purposes of this training, you can download it for free at
You will need a PHP parser to process scripts. A parser generates HTML output that will be sent to the browser. You can download it for free at the PHP website.
XAMPP is a beginner-friendly open source cross-platform distribution by Apache. It contains the important tools you need to set up a web server for testing purposes: Apache (server application), MySQL (database application), and PHP (scripting language). The X in the acronym stands for cross-platform. This indicates that XAMPP can be used equally well on Windows, Mac, or Linux.
Since XAMPP’s components are also widely used in actual web server deployment, you will find it extremely easy to switch to a live server. XAMPP includes the following key components:
To download an executable file that you can extract to set up XAMPP on your computer, you will need to select a version on the download page of Apache friends: https://www.apachefriends.org/download.html
For this tutorial, you may download the version of 7.1.1 / PHP 7.1.1. Simply click on the executable file to start the installation process. The setup wizard will display the different components that will be installed which consist of the following:
FileZilla FTP Server
Mercury Mail Server
Except for Apache and PHP, you can uncheck components that you don’t intend to use. This tutorial will accept the default components and install everything. The next dialogue will prompt you to provide the directory in which you want
XAMPP to be installed. The default installation folder is C:\xampp. Once the installation is done, you will be prompted with an option to start the Control Panel. Select that checkbox to begin working with XAMPP.
XAMPP Control Panel
XAMPP’s control panel allows you to control all installed modules. You can use it to start or stop a module, access the Windows Explorer, and view all running operations.
Testing XAMPP Installation
You can check if XAMPP had been successfully installed on your computer by launching Apache web server and writing/running a simple PHP script. First, click on the XAMPP icon. You will be asked to choose the language and save your preference. You will then be taken to the Control Panel. To start the Apache module, you can click on Start beneath the Actions caption. Next, open the web browser then type
Another option is to type
You will see the dashboard and the message that you have successfully installed XAMPP on the system and that you can now start using its components.
To check if PHP was installed successfully, you can write a simple PHP script using Notepad. Type the following:
<?php echo 'Hello, World!'; ?>
You can save this document as try.php in the htdocs folder within the xampp installation. For example, if xampp was installed in drive c, you will save your new file in c:\xampp\htdocs. Save the file as Al Files. Next, type
on your browser. You should see the following:
You have just created your first ever PHP program using a local Apache webserver. You can start learning more complex and exciting web apps with the succeeding articles of this site web.
While PHP can be forgiving, learning its syntax will ensure that your code will run as expected. This chapter will discuss the important aspects of PHP syntax. First of all, you will need to tell the PHP parsing engine that it is dealing with a PHP element. There are different ways of doing this.
The Basic Syntax
ou can place a PHP script virtually anywhere in a web document. The most universally accepted tag style for introducing a PHP script is by enclosing the PHP element with the start tag
and ending it with
Take note of this syntax: