PHP101
Technical Requirements
Operating System Options
- Windows XP Service Pack 2
- Windows Vista
- Windows 7
- Mac OS X
XAMPP or MAMP
Instead of installing a Web Server, Applications Server, and Database separately, you can install one of the following all-in-one packages:
- XAMPP (Apache, PHP, MySQL on Windows)
- MAMP (Apache, PHP, MySQL on Macintosh)
Installing XAMPP
XAMPP is a free distribution that makes it easy to install Apache Web Server, PHP, PEAR, and MySQL. Before installing XAMPP, you should turn off any other web servers you have running on your machine. NOTE: If you are having trouble installing XAMPP go to this link to view Instructions for Linux, Windows, MAC and Solaris.
- Go to http://www.apachefriends.org/en/xampp.html and choose XAMPP for Windows, Linux, or Mac OS X (depending on your own operating system) and download the Installer file for XAMPP (not XAMPP Lite).
- After downloading the program, simply run it. XAMPP needs to be installed into a top-level folder (e.g., the C drive).
- You can start it by running XAMPP_Start.exe in the XAMPP folder (e.g., C:\XAMPP). This will start Apache Web Server, PHP and MySQL.
- To test the install, navigate to http://localhost. You should see the XAMPP home page.
Installing XAMPP on 64-bit OS
- For instructions on installing XAMPP on a 64-bit Windows OS, see Getting XAMPP to work on Windows 7 (64-bit).
Setting the MySQL Password
- The PHP files use "pwdpwd" for the MySQL root password, while the default password is NO password.
- Change the password by navigating to http://localhost/security and entering pwdpwd under the MYSQL SECTION: "ROOT" PASSWORD heading and submitting the form.
Setting up MDB2
First check to see if you have Pear installed by typing the following at the command line:
cd C:\xampp\php
pear
If Pear is installed, you should get a list of commands.
If you do not have Pear installed, you must first install Pear.
If you don't have Pear installed
1.Create a folder called c:\php.
2.Download the installation script at http://pear.php.net/go-pear.phar. Save it to c:\xampp\php.
3.Type the following at the command line:
cd c:\xampp\php
php go-pear.phar
4.When prompted for system or local install, type "l" (for local). When asked to confirm, type "yes".
5.When prompted about the file layout, press ENTER to accept the default layout.
6.Add your PEAR installation path (i.e., c:\xampp\php\PEAR) to your include_path in the c:\xampp\php\php.ini file.
Set up MDB2
Once Pear is installed, you must make sure you have the latest version of MDB2 and that your mysqli driver is installed. Type the following at the command line:
cd c:\xampp\php
pear install MDB2-2.5.0b3
pear install MDB2_Driver_mysqli
Configuring php.ini not to show all errors
MDB2 uses some deprecated methods. To prevent strict warning messages from showing up on your web pages, change the error reporting settings in the C:\xampp\php\php.ini file from: error_reporting = E_ALL | E_STRICT to: error_reporting = E_ALL & ~E_DEPRECATED
- Restart APACHE
Installing Northwind Database using XAMPP
NOTE: you should download the class files below before following these instructions, as it contains the Northwinds Database file(s).
- To install the Northwind database used in class, click on the "phpMyAdmin" link on the left navigation bar of the XAMPP home page. That should take you to http://localhost/phpmyadmin.
- On that page, click on the Import link under the Localhost heading.
- Browse to the Northwind-MySQL.sql file in your class files.
- Click the Go button on the bottom right of the page.
- You should get a Success message and Northwind should be added to the Database dropdown menu on the upper left of the page.
Any Text or HTML Editor
If you don't already have something to use for Plain Text editing or Web authoring, please choose one of the options listed below.
Windows
- Crimson Editor - Download
- Notepad is fine for class and is usually included with Windows.
- Adobe Dreamweaver - Download(recommended)
Mac OS X
- TextEdit is fine for class and is usually included with Mac OS X.
- Please ensure you choose Format > Make Plain Text from the TextEdit toolbar.
- TextWrangler - Download
- Adobe Dreamweaver - Download
NOTE: The following only applies if you are using Dreamweaver for your text editor. If you are not, please ignore this section.
Designate your testing server in Dreamweaver
- Go to Site > New Site.
- In the Site Setup dialog, fill in the Site Name (e.g., PHP) and browse to the Local Site Folder (e.g., c:\XAMPP\htdocs\Webucator\ClassFiles\).
- Choose the Servers tab.
- At the bottom of the box on the right, click +.
- On the Basic tab, provide a Server Name, set Connect using to Local/Network, ensure the Server Folder matches the local site folder you specified in step 2, and set the Web URL to http://localhost/Webucator/ClassFiles/.
- Click the Advanced button.
- In the Server Model field, select PHP MySQL.
- Click Save. The server should appear in the table on the Servers tab.
- Make sure that both the Remote and Testing checkboxes are checked.
- Click Save.
Class Files
- Download the class files.
- After downloading the class files, create a directory on your hard drive named "Webucator" that can be found easily.
- On Windows it is recommended the new folder have a path of C:\Webucator.*
- On Mac OS X a good location for the new folder may be in your Documents directory.
- Extract the files to the folder you just created.
* If you are using XAMPP (e.g, for PHP classes), you must place the Webucator folder to the C:\xampp\htdocs folder.
|
|