PHP - Basics - Part 3 - Development Web Server Role in PHP
Temmuz 5, 2012 by PHP Tutorial
|
|
This PHP Tutorial contains and tries to cover following subjects:
- Explanation of installing Web Server for PHP
- Brief introduction to Apache Web Server
Articles tries to provide answer to following questions and issues:
- What is Apache Web Server
- How to install Web Server (Apache) for PHP?
- Web Server configurations - selections for PHP?
- How to install development server for PHP?
Articles pre-requisites following information:
- General knowledge of Scripting
- General knowledge of HTML
- General knowledge of CSS
- General knowledge of RDBMS and SQL
Development Server Role in PHP
In this PHP Tutorial, we will cover Installing Web Server which is required to serve as development local server to test and debug PHP codes.
First, lets look into subject of Why we need a development server, what is a development server and what are options. As we mentioned earlier, PHP is a server-side scripting language. When a PHP web application is compiled, it is hosted in a Web server that can run that compiled script, to generate HTML page or related web content from script into the page to send to the client (to browser that requested a page). To be more specific, a PHP page in a web server works as "run-time". Similar to a application that runs in windows. Windows is some sort of server that applications work in "run-time" when we open them or they work as service or similar way of entities.
Therefore, we need a web server to test PHP code that we developed. In PHP area, mostly Apache Web server is preferred, due to being a free web server. Since PHP, Apache Web Server and MySQL is a combo open-source free applications, they are preferred.
If we do not install a web server, we have to upload compiled PHP code to a server which is hosted in a remote location (to a hosted server), and that makes development harder. When you change a code, and compile the PHP page, it will be required to upload it again into the hosted server. To not encounter such issues, we will install a web server to local, to serve as a development server.
Lets check the Web server combos, the options. In programming sector, there is 3 main combo for a PHP web application, As acronyms:
- WAMP (Windows, Apache Server, MySQL, PHP)
- MAMP (Mac, Apache Server, MySQL, PHP)
- LAMP (Linux, Apache Server, MySQL, PHP)
Considering above combos, you can use any of them or use custom combos. However, custom combos require longer work, and harder to fit one into each. Because above combos are also bundle, which means, they are provided as a package for a PHP developer to deploy solution.
Remark here that, we wont be installing a production web server. The web server which serves as development server is different than a production web server. Production servers are using different and more sophisticated configurations.
From above combos, we will pick up WAMP for further php tutorials. Zend Server is a commonly used WAMP bundle package for web server. First step will be downloading Zend CE Server.
To download PHP web server, we downloaded latest version. Next tutorial we will install that development server.
Data Layers
Area: | programming \ languages \ php \ \ \ |
Ref: | |
Loc: | articles |
Tags: | php |
|