Child

PHP Introduction: What is PHP ?


PHP is a server side scripting language, widely used in internet programming. We can develop pages with dynamic content by using PHP. By using PHP we can interact with database servers and manage the page content accordingly. The difference between a static page like HTML and dynamic page like PHP is the way the server interpret the request. 

Here are some resources and downloads for PHP 

Set Up PHP on Your Own PC

However, if your server does not support PHP, you must:

  • install a web server XAMPP || or || WAMPP
  • install PHP
  • install a database, such as MySQL
Let us take one simple example.



Server request for static html page by client 
When ever request comes for a static html or htm page the web server returns the page to the client. Here script processing or execution is not done. Such pages don't have dynamic capability and content is fixed. In Windows server the web server is IIS and for Linux systems Apache web servers are generally used. However PHP and Apache runs well in Windows platform also. This site is supporting PHP on a Linux platform. In the same way the server can run other scripts like ASP, Perl etc. PHP can be downloaded from www.php.net 
Server executes the Script by PHP engine and then post back the data to client 
Incase of PHP pages the server does not return the page directly to the client. The web server runs the PHP engine and the output of the executed script is posted back to the client machine.  Depending on the various input conditions the page content can be changed.  PHP can easily connect to MySQL database and this combination is very popular in the internet 
As per the client side browser it does not understand PHP or any other language. It can understand HTML, JavaScript, CSS etc. 

The file extensions for PHP pages
Web sites are organized at the server like we organize files and folders. So when we open a website one of the default file opens as home page of the site. Read here on how to fix the default page of a website . Usually files with php or php3 ( in old version of PHP ) extensions are files which contain PHP code. Same way we can say the files with .asp are the active server page files contains asp code. But this is not always true. At the server settings we can change the settings and tell the web server which type of files to execute through which engine or scripting language. A file with .htm extension can pass through php engine to execute php codes present inside. Read how IIS is set to pass different extensions through different engines. 

However after executing different types engines the final script is posted to user browser which does not contain any PHP, ASP or any other types of scripting language and it only contains HTML and other client side scripts. 

Set Up PHP on Your Own PC

However, if your server does not support PHP, you must:

  • install a web server XAMPP || or || WAMPP
  • install PHP
  • install a database, such as MySQL