Now it’s time to move on to the actual project files and get them running on a local machine.
Setting up the development environment
- WAMP Server – This program offers a great way of running PHP/MySQL applications on a local machine through an easy to use interface. It also functions as a web server so that other internet users can access websites that are stored on your PC just like if they were hosted on a professional web server.
- Oracle Java Software Development Kit (JDK) – Java isn’t needed to run this project but it’s required if you want to run Oracle SQL Developer. Since I’ve used Oracle SQL Developer to design the website’s database, it’s necessary that Java JDK is installed in order for the Database Administrator to be able to make changes to the Database.
- Oracle 11g Express Edition – The website’s database is entirely build on Oracle Server 11g
- Download WAMP Server from here
- Install WAMP Server. During the installation make sure to specify an easy to remember location for the program. I recommend using the default
- Download Java JRE from here
- Install Java JRE
- Download Java JDK from here
- Install Java JDK and make note of the location where you installed it. By default this should be
- Download Oracle 11g Express Edition from here
- Install Oracle 11g Express Edition. During the install process, you’ll be asked to enter a password for your database. Make sure you write down this password as it will be needed to later access the server.
- Download Oracle SQL Developer from here
- Unzip to the desktop the archive downloaded on step 9.
Now that the Oracle server is installed, it’s time to create a new user. This user’s credentials will be used to access the database from PHP so make sure to write down his login information.
- Go to Start -> Oracle Database -> Run SQL Command Line
- In the command window that opens up, type connect, enter the user name SYSTEM and the password that you set on „Installation steps”, step 8.
- Create a new user using the create user command. The syntax for this command is as follows:
create user user_name identified by user_password;
- Grant the newly created user dba rights:
grant connect, resource to user_name;
- In SQL Developer go to File -> New -> Database Connection
- Enter a Connection Name (can be anything you want). For Username and Password use the credentials created on step 3. Be sure to check Save Password.
- Leave the other fields unchanged. Press Test to test this connection then Save and Connect.
The next part in this setup process is to create and initialize the database. Here’s what you need to do.
- Locate the database creation script,
alarme_buzau_database.sqland open it in Notepad or any other plain-text editor.
- Select all of the lines in this file with Ctrl + A and copy them to the computer’s clipboard with Ctrl + C.
- Go to Oracle SQL Developer.
- Right click on the connection you created earlier and choose Connect.
- On the right side of the screen a new tab will open. Click in it and paste the database creation instructions with Ctrl + V
- Press F5 to run the script and create the database.
The last part of the setup process involves copying the website files and making them work with the database. Here are the steps that you need to follow:
- Locate the website folder named alarme_buzau
- Place this folder in your WAMP installation folder, this is by default
c:\wamp\www. The final path to the website should be
- In your website folder, go to
script\functions.phpand open this file in a text editor.
- Change the two variables
$dbPassso that they contain the credentials created in “Setup process” step 3. The line should look similar to the one below. Be careful not to erase the quotations around each of the values.
//================== Database Connection ==================== $dbUser = "AA"; $dbPass = "aa"; $dbServer = "localhost";
- Setup is now complete. In order to run the website you need to start WAMP Server by double clicking the shortcut on your desktop.
- Open your web browser and go to the following address: