PHP – Installation and Testing
- PHP programmes need a running environment that is a web server or local server for running our programmes.
- For learning purpose we prefer local servers because the web servers are more costly than local servers.
- Each operating system has there own local severs.
- For Windows operating system use WAMP.
- For Linux operating system use LAMP.
- For Mac operating system use MAMP.
- XAMPP is a close platform server, that is XAMPP server is used for all operating systems.
- WAMP, LAMP, MAMP and XAMPP are basically software kits it contain Apache, MySQL and PHP.
Now we discuss about how to install local servers in our system. The installation process is different in different operating systems. So we must say about installation of WAMP, LAMP and MAMP separately.
WAMP installation and running
WAMP is Windows Apache MySQL and PHP. There is 64 bit and 32 bit WAMP servers are available in market. Based on the nature of computer the user can download 32 bit WAMP or 64 bit WAMP.
Step 1: Download the setup file WAMP server.
Step 2: Double click on on the setup file.
Step 3: Click on next button.
Step 4: Now the user get a box with two options “create a quick launch icon and create a desktop icon” if you want any option just give tick on that option and go to next button.
Step 5: Now user get an install button and click on that install button. Installation completed after this step.
Step 6: The next step is to start WAMP server for that go to installed file and double click on the WAMP icon.
Step 7: Go to task bar menu and click on the WAMP button.
Step 8: Select the localhost and now you get the home page.
Testing
In WAMP server the testing is done by the web browser. For run the program the user set the path on web browser. The path is like localhost/folder name/file name. The localhost pointed to the
folder. It is the directory locating the php file folder and remaining path set manually.C:\wamp\www
LAMP installation and running
LAMP is Linux Apache MySQL and PHP. LAMP installation and running is are processed in terminals using commands. The commands are
Step 1: sudo apt-get update
Step 2: sudo apt-get install get
These two steps are used to install and after installation the user wants to start the LAMP.
Step 1: sudo /opt/lampp/lampp start
Step 2: cd /opt/lampp/htdocs
Step 3: sudo chmod -R 777 folder name
Now server is ready to run.
Testing
In LAMP server the testing is done by the web browser. For run the program the user set the path on web browser. The path is like localhost/folder name/file name. The localhost is locating the php file folder and remaining path set manually.
MAMP installation and running
MAMP is Mac Apache MySQL and PHP.
Step 1: Download the setup file MAMP server.
Step 2: Double click on on the setup file.
Step 3: Agree license terms.
Step 4: Click on “Install for all users of this computer” button.
Step 5: Now installation start and completed.
Step 6: The next step is to start MAMP server for that go to installed file and double click on the MAMP folder.
Step 7: Go to MAMP icon. Now the user get MAMP welcome page with Apache, PHP and other configuration.
Testing
In MAMP server the testing is done by the web browser. For run the program the user set the path on web browser. The path is like localhost/folder name/file name. Here localhost is locating the php file folder (Applications/mamp/htdocs/) and remaining path set manually. In MAMP server we also include with in the path default port number of Apache in MAMP server that is 8888. ( localhost:8888/folder_name/file_name )