12. Question?
What do we need for a dynamic website?
Dynamic: Content of pages can change depending on
factors such as time, user and etc.
13. XAMPP
X ( L = Linux, M = Mac, W= Windows but X = cross-platform)
Apache Server
MySQL
PHP
Perl
14. Apache Server
HTTP Server
Written in C
Open Source
Windows, Linux, Mac OS X, Solaris, etc.
By 2013 54.2% of all websites used Apache
15. What is HTTP?
Hypertext Transfer Protocol
HTTP is the foundation of data communication for
the World Wide Web.
Hypertext is structured text that uses logical links
(hyperlinks) between nodes containing text.
HTTP is a request-response protocol between server
and client to transfer data
18. PHP
PHP: Hypertext Preprocessor (recursive acronym )
PHP is a server-side scripting language designed
for web development
PHP code is interpreted by a web server with a PHP
processor module
19. Perl
Perl is a programming language. In the web
development environment, Perl is a very powerful
way to create dynamic web pages.
20. PHP vs Perl?
PHP is easier to learn
PHP is inline scripting language while Perl is not
It is written within HTML code
PHP is usually faster
Perl much more powerfull in regex (PHP actually
uses Perl to provide regex)
Etc.
21. How to install XAMPP?
Install on USB Flash Drive using zip file
Install on USB Flash Drive
Install on Mac
Install on Windows
22. Install on USB Flash Drive using the zip file
Download the zip file from
http://sourceforge.net/projects/xampp/files/XAMPP%
20Windows/1.8.3/xampp-win32-1.8.3-4-
VC11.zip/download
Unzip the files into a directory in the root of the
flash drive and name it xampp.
In the xampp directory run “setup-xampp.bat” file
to setup xampp settings in the current directory
Run “xampp-control.exe”
Continue the rest from slide 29
23. XAMPP for Portable for Windows
on USB
Use the following link to download the portable
installer:
http://sourceforge.net/projects/xampp/files/XAMPP%
20Windows/1.8.3/xampp-portable-win32-1.8.3-1-
VC11-installer.exe/download
24. Portable XAMPP for Windows
Installer will show you the a welcome window. Click
next.
25. Portable XAMPP for Windows
Installer will show options you can choose from,
preferably, keep everything unless your running
short of disc. You definitely will need MySQL, PHP,
PHPMyAdmin and Apache.
26. Portable XAMPP for Windows
Next page will ask you to choose proper location.
For portable installation choose the USB flash drive.
27. Portable XAMPP for Windows
After progress bar is finished click next till you can
click on Finish.
38. XAMPP for MAC
In application window:
go to Manage Servers tab
All servers should have been started otherwise choose
them and click on start. (You may need to give
permissions)
39. XAMPP for MAC
Make sure you don’t have any other instance of
these Apache server or MySQL server running on
your machine
Stop them if any existed
Stop Apache in terminal by running the following
command:
sudo apachectl stop
Stop MySQL by running the following command in
Terminal:
sudo /usr/local/mysql/support-files/mysql.server stop
40. XAMPP for MAC
Try XAMPP by clicking on “Go To Application” in
“Welcome” Tab
This what you will have to see in your browser.
Under http://localhost/xampp/splash.php
41. XAMPP for MAC
Try XAMPP Installation by clicking on “Go To
Application Folder” in “Welcome” Tab
There should be similar content in xamppfiles as shown
in picture
42. XAMPP for MAC
htdocs in xamppfiles is where you can store all
your future PHP, HTML or any other files types
needed.
43. Install on Windows
Go to:
https://www.apachefriends.org/download.html
Download desired version (preferably the one with
the news PHP version)
45. Install on Windows
Installer will show options you can choose from,
preferably, keep everything unless your running
short of disc. You definitely will need MySQL, PHP,
PHPMyAdmin and Apache.
46. Install on Windows
Next page will ask you to choose proper location.
Choose a proper place on your Hard Drive.
47. Install on Windows
After progress bar is finished click next till you can
click on Finish.
49. Install on Windows
Start Apache and MySQL servers when you open
xampp from the installation folder.
50. Install on Windows
To test, click on Admin button for Apache server and
you will see a page similar to the following.
51. Playing Around With Configs
How to have two different apache servers?
What is the problem here? Why do you think that
we had to stop the previous apache server? What
if I want them to work simultaneously?
52. Problem?
Both servers what to listen to the same port?
Port 80
We have to change setting to use different port on
XAMPP
53. Change Apache Port on Mac
In Manage Servers tab, choose to highlight Apache
Web Server and click on Configure.
54. Change Apache Port on Mac
Change 80 to any port above 1024. Since anything
below it is a reserved port. For example 8080 and
restart server.
55. Change Apache Port on Mac
Now
http://localhost/xampp doesn’t work anymore but
http://localhost:8080/xampp is now active
56. Fix on Windows
On windows you’ll clock on Config in the top right
corner.
Then you’ll click on Service and Port Settings in the
new window an you’ll change 80 to 8080 in the
new window and you’ll need to also save
57.
58. Change Apache Port on Windows
Now
http://localhost/xampp doesn’t work anymore but
http://localhost:8080/xampp is now active
59. In case the GUI didn’t work
Go to:
Mac OS X:
“/Applications/XAMPP/xampfiles/etc/”
Windows:
<USB drive letter>:apacheconf
Open the file:
httpd.conf
Apply following changes:
Find the line which specifies the port number
“Listen 80”
It should be at line 58 in Windows and 52 In Mac
Change the port from 80 to anything you desire
Save and exit the file
Restart apache server
Test it
Localhost:<port number>
60. Safety Issues
If you visit the security status page
http://localhost/security/index.php
You will se that there are three security errors
61. To fix this on Mac
Run
sudo /Applications/XAMPP/xamppfiles/xampp
security
Then open MySQL config file using the menues and
find the line with:
#password = your_password
Remove # and change “your_password” to any password
you desire.
62. Fix on Windows
Go to
http://localhost/security/xamppsecurity.php
Select password for both MySQL and XAMPP
pages.