1. Introduction to In this course, we are going to use: Apache web server PHP installed as a module for Apache Database management system MySQL and the web application PHPMyAdmin to administrate it. It is possible to download all those applications and to install them independently. However, this process takes time and it is prone to errors. That is why we use XAMPP. XAMPP is an easy to install Apache distribution containing MySQL, PHP and Perl together with other components such as ftp servers, mail servers, OpenSSL... XAMPP is really very easy to install and to use - just download, extract and start. XAMPP is free of charge and most of its components are open source. XAMPP is an integrated system that includes the following components: a. Apache web server and PHP and Perl modules for Apache. b. Database management system MySQL and the web application PHPmyAdmin to administrate it. c. Other components such as ftp servers, mail servers, OpenSSL, etcetera. XAMPP can be downloaded from: http://www.apachefriends.org/en/xampp.html. In that web you can also find installation instructions for Windows, MacOS and Linux. You must have privileged access to install and configure XAMPP, otherwise there will be errors during the installation. After the installation, all XAMPP services are administered in the XAMPP Control Panel Application, which can be started by executing xampp-control.exe: Figure 1: XAMPP Control Panel Application From this control panel, the main modules (such as Apache and MySQL) can be started and stopped. Additionally, it also allows configuring these modules as services, which are automatically started when the system boots. 1
2. Exercises with XAMPP and Apache a. Check that XAMPP is installed on your system by opening the XAMPP Control Panel. Make sure that both Apache and MySql are running and start them if they are not. b. Open the default web page in http://localhost and browse the information on these pages. Specially interesting are the web pages with information about the PHP interpreter (phpinfo()), the management tools of MySQL (phpmyadmin) and the server activity monitoring (Webalizer). c. Check what happens if you stop Apache and, then, try to open http://localhost again in the web browser. d. Create a folder called ABD inside the Apache web directory. Copy some files into that folder and try to access to this file through the web browser. Figure 2: XAMPP web site 2
3. Exercises with MySql a. Open phpmyadmin, which is the tool that we are going to use to manage MySql. PhpMyAdmin is a web application and you can find it in the tools section at http://localhost b. Create a new database called Practica1 c. Open that database and create a table called Students with several fields: name, surname, course d. Try to insert, query, update and delete information from that table. Figure 3: Results of a query in phpmyadmin 3
4. Introduction to Aptana is an Eclipse-based integrated development environment (IDE) to support the development of web applications. Aptana includes support for HTML,XHTML, CSS, JavaScript, DOM, PHP and several other languages by means of plugins. The main features of Aptana are: - Colored syntax for the aforementioned file types. - Autocomplete of code and tags. - Code validation and unified notification of errors. - Integrated support to several JavaScript AJAX libraries. The main window in Aptana is as follows: Aptana uses the concept of project. A project is a container that is used by the IDE to group related files and folders. Typically projects group html, css, js and php files of a single web site. To create a new project in aptana, select File New Project, and a wizard will guide you through the process. 4
5. Exercices with Aptana a. Create a new Project: b. Create in the project a new web page with the text Hello World and display it in the web browser. 5