PHP
PHP is an acronym for “PHP: Hypertext Preprocessor”.PHP is a widely-used, open source scripting language.PHP scripts are executed on the server
PHP File
- PHP files can contain text, HTML, CSS, JavaScript, and PHP code
- The PHP code is executed on the server, and the result is returned to the browser as plain HTML
- PHP files have an extension “.php”
PHP File Example
<!DOCTYPE html>
<html>
<body>
<?php
echo “First Test!”;
?></body>
</html>
PHP Compatible
- PHP runs on various platforms (Windows, Linux, Unix, Mac OS X, etc.)
- PHP is compatible with almost all servers used today (Apache, IIS, etc.)
- PHP supports a wide range of databases
- PHP is free. Download it from the official PHP resource: www.php.net
- PHP is easy to learn and runs efficiently on the server side
How to Setup Web Server with localhost
Purchase domain name and hosting name.Examples Godaddy, Alicloud etc.
In Hosting, we have to install
For windows
- Apache
- Php
- Phpmyadmin
- xampp
- or install wamp Download Link
For Mac
- Mamp
- Install Mamp Download Link
How to give path to folders
For Mac
- Open htdocs folder
- Create the folder with any name example, Directory
- In the Directory create an index.php file
- On the server in mamp
- Click on website option and folder appear on the screen.
- Click on directory folder which we created in the starting.
- After this, the website appears on the screen
- Congratulations, It is done
For Window
- Open wamp
- Open www folder
- Write code in an index.php file
- Open Browser
- Type localhost in the address bar
- After this, the website appears on the screen
- Congratulations, It is done.