PHP Installation:
For PHP to work, you need a server as PHP is a server-side scripting language. If your server supports PHP you don't need to do anything.
Just create some .php files in your web directory, and the server will parse them for you. Because it is free, most web hosts offer PHP support.
However, if your server does not support PHP, you must install PHP.
Then you have to download PHP, a database and a server.
PHP supports many databases (MySQL, Informix, Oracle, Sybase, Solid, PostgreSQL, Generic ODBC, etc.).
PHP is compatible with almost all servers used today (Apache, IIS, etc.).
Alternative method:
Install WAMP server on your computer.
WAMPs are packages of independently-created programs installed on computers that use a Microsoft Windows operating system.
In WAMP, W stands for windows, A stands for apache server, M stands for mysql, P stands for php, However, for linux users there is LAMP available. L stands for Linux and remain same.
Functionalities of WAMP:
WampServer's functionalities are very complete and easy to use so we won't explain here how to use them.
With a left click on WampServer's icon, you will be able to:
- manage your Apache and MySQL services
- switch online/offline (give access to everyone or only localhost)
- install and switch Apache, MySQL and PHP releases
- manage your servers settings
- access your logs
- access your settings files
- create alias
With a right click :
- change WampServer's menu language
- access this page
How to start WAMP:
When you install WampServer, a "www" directory is created (generally c:\wamp\www). Create a directory inside for your project and put your PHP files in it.
Click on the link "Localhost" in the WampServer menu or open your browser and open the http://localhost address.
Add Apache, MySQL and PHP releases
WampServer allows you to install almost all the existing releases of Apache, PHP and MySQL so you can reproduce exactly the settings of your production server.
Then click on the WampServer menu and activate the release that you want to use.
Wait until the WampServer icon become white again and start to work.
PHP Extensions:
PHP files have file extension of “.php”, “.php3”, “.phtml”.
But mostly .php is used.
Important terms:
Localhost: A server application running on your on computer. It always translates to the loopback IP address 127.0.0.1 in IPv4, or ::1 in IPv6.