PHP is just one of many popular Web server side open source scripting languages. It is widely used for Web application development. There are over half million server pages developed by PHP. It is still growing very fast.
PHP is often embedded into HTML to enhance functions of HTML. PHP allows you to interact with a HTML page dynamically. PHP collect data from page where user provides and then process and utilize data to create a dynamic home page output.
PHP can do all tasks that ASP and JSP can do plus it is free. Why is PHP so popular?
The answer is following:
PHP is Open Source and free
PHP is much compact than Java and .NET in term of its system size
PHP marries HTML well because PHP is designed to be used along with HTML. You can embed PHP into HTML document, or put HTML tags in PHP coding seamlessly.
In addition, PHP gets alone with MySQL very well. These two make up the best combination for data-driven Web application cross-platform. PHP can also support a massive number of databases, including Informix, Oracle, Sybase, and ODBC drivers.
Practice lab for PHP Web application on Apache
In this section, you will be given a hands-on lab on a “Hello user” Apache server and PHP Web project. A PHP based on HTTP server page is populated on an Apache Web server. If a Web client accesses this page and fill in his/her name as then the PHP page will dynamically create a response page which responds a greeting statement “Hello ”.
After installing Apache server, you can download and install PHP with http://www.php.net/downloads.php. The installation manual at http://www.php.net/install.windows may be helpful. The binary installer is very easy to use. However, if you want to use manual installation, you need to extract the php 5.x into C:\php. You may choose a different location but do not leave any spaces in the path (like C:\Program Files\PHP) as some Web servers will crash if you do so.
In your php directory, there are two files: php.ini-dist and php.ini-recommended. Change one of them into php.ini (php.ini-recommended is preferred).
First, edit php.ini file as follows:
doc_root = C:\xampp\htdocs
extension_dir = "c:\xampp\php\ext"
Next, edit Apache configuration file httpd.conf. Add following lines into it, the PHP would work as a module: