Getting Started with PHP

By: Wang Li (from php.net) Emailed: 1603 times Printed: 2075 times    

Latest comments
By: rohit kumar - how this program is work
By: Kirti - Hi..thx for the hadoop in
By: Spijker - I have altered the code a
By: ali mohammed - why we use the java in ne
By: ali mohammed - why we use the java in ne
By: mizhelle - when I exported the data
By: raul - no output as well, i'm ge
By: Rajesh - thanx very much...
By: Suindu De - Suppose we are executing

Before getting started, first you need to know what do you want to use PHP for. There are three main fields you can use PHP:

  • Websites and web applications (server-side scripting)
  • Command line scripting
  • Desktop (GUI) applications

For the first and most common form, you need three things: PHP itself, a web server and a web browser. You probably already have a web browser, and depending on your operating system setup, you may also have a web server (e.g. Apache on Linux and MacOS X; IIS on Windows). You may also rent webspace at a company. This way, you don't need to set up anything on your own, only write your PHP scripts, upload it to the server you rent, and see the results in your browser.

In case of setting up the server and PHP on your own, you have two choices for the method of connecting PHP to the server. For many servers PHP has a direct module interface (also called SAPI). These servers include Apache, Microsoft Internet Information Server, Netscape and iPlanet servers. Many other servers have support for ISAPI, the Microsoft module interface (OmniHTTPd for example). If PHP has no module support for your web server, you can always use it as a CGI or FastCGI processor. This means you set up your server to use the CGI executable of PHP to process all PHP file requests on the server.

If you are also interested to use PHP for command line scripting (e.g. write scripts autogenerating some images for you offline, or processing text files depending on some arguments you pass to them), you always need the command line executable. For more information, read the section about writing command line PHP applications. In this case, you need no server and no browser.

With PHP you can also write desktop GUI applications using the PHP-GTK extension. This is a completely different approach than writing web pages, as you do not output any HTML, but manage windows and objects within them. For more information about PHP-GTK, please » visit the site dedicated to this extension. PHP-GTK is not included in the official PHP distribution.

From now on, this section deals with setting up PHP for web servers on Unix and Windows with server module interfaces and CGI executables. You will also find information on the command line executable in the following sections.

PHP source code and binary distributions for Windows can be found at » http://www.php.net/downloads.php. We recommend you to choose a » mirror nearest to you for downloading the distributions.


PHP Home | All PHP Tutorials | Latest PHP Tutorials

Sponsored Links

If this tutorial doesn't answer your question, or you have a specific question, just ask an expert here. Post your question to get a direct answer.



Bookmark and Share

Comments(0)


Be the first one to add a comment

Your name (required):


Your email(required, will not be shown to the public):


Your sites URL (optional):


Your comments:



More Tutorials by Wang Li (from php.net)
Getting Started with PHP

More Tutorials in PHP
PHP code to import from CSV file to MySQL
PHP code to write to a CSV file from MySQL query
PHP code to write to a CSV file for Microsoft Applications
Convert XML to CSV in PHP
Password must include both numeric and alphabetic characters - Magento
PHP file upload (Large Files)
PHP file upload prompts authentication for anonymous users
PHP file upload with IIS on windows XP/2000 etc
Error: Length parameter must be greater than 0
Multiple File Upload in PHP using IFRAME
Resume or Pause File Uploads in PHP
Exception in module wampmanager.exe at 000F15A0 in Windows 8
Handling file locks in PHP
HTML table output using Nested for loops in PHP
Count occurrences of a character in a String in PHP

More Latest News
Most Viewed Articles (in PHP )
parent:: AND self:: in PHP
Function to return number of digits of an integer in PHP
Error: Length parameter must be greater than 0
Getting Started with PHP
isset() function in PHP
Reading and Writing .gz files in PHP
Find Difference between two dates in PHP
Parent: child process exited with status 3221225477 -- Restarting
How to fix: Warning: Visiting this site may harm your computer - domainameat.cc
XMLRPC for PHP - A simple client and server program
Building a Video Sharing Site using PHP in AWS
Encrypting files using GnuPG (GPG) via PHP
Get the next working day in PHP
HTML table output using Nested for loops in PHP
Count occurrences of a character in a String in PHP
Most Emailed Articles (in PHP)
preg_split() and explode() in PHP
Cannot load /usr/local/apache/libexec/libphp4.so into server: ld.so.1:......
Convert XML to CSV in PHP
Handling BLOB in PHP and MySQL
Where does the PHP run?
Handling file locks in PHP
Exception in module wampmanager.exe at 000F15A0 in Windows 8
Password must include both numeric and alphabetic characters - Magento
PHP code to import from CSV file to MySQL
PHP code to write to a CSV file from MySQL query
History and origin of PHP
Traversing Arrays Using foreach in PHP
Reading word by word from a file in PHP
Upload and Download files with FTP in PHP
Encrypting and decrypting in PHP