Web Programming-2(PHP)

Chapter 02: Getting Ready to Work with PHP Task for You!

 Get Familiar with Telnet, HTTP, and Port Numbers

2 What You Need for a Local Test Environment  A : this is a piece of software that displays webpages, not a separate computer.  PHP  MySQL and a web-based front end for MySQL called phpMyAdmin, which are required in order to work with a Individual Programs or an All-in-one Package?  You can download and install PHP, MySQL and Apache individually or you can use some package such as XAMPP, WAMP or MAMP that contains all the in one package. XAMPP

 XAMPP is a free and open source cross-platform web server package, consisting mainly of the Apache HTTP Server, MySQL database and interpreters for scripts written in the PHP and programming languages.

5 XAMPP (Cont.)

 XAMPP's name is an acronym for:

– X (meaning cross-platform) – Apache HTTP Server – MySQL – PHP – Perl

6 Download Links

 Xampp for – http://www.apachefriends.org/en/xampp-linux.html  Xampp for Windows – http://www.apachefriends.org/en/xampp-windows.html  Xampp for Mac OS X – http://www.apachefriends.org/en/xampp-macosx.html  Xampp for Solaris – http://www.apachefriends.org/en/xampp-solaris.html

7 Alternative Options  WampServer  EsayPHP  UwAmp Server  AMPPS  MAMP  For more information visit: https://merabheja.com/alternatives-of-xampp-server/ Installation

 Stop Skype or Disable:  Use port 80 and 443 as alternatives for incoming connections in your skype.  For latest installation visit:  https://www.wikihow.com/Install-XAMPP-for-Windows

9 Installation

1

2

3 10 Installation

4

5

6

11  Now, fire up your favorite browser and in the address bar, enter http://localhost or http://127.0.0.1 and afterward select your language To continue.

12 Job Done!

13  Click on STATUS in the left column to confirm what’s running and what’s not.

14 Where to Locate Your PHP Files?  You need to create your files in a location where the web server can process them.  Normally, this means that the files should be in the server’s document root or in a subfolder of the document root.  The default location of the document root for the XAMPP will be: C:\xampp\htdocs  To view a PHP page, you need to load it in a browser using a URL.  The URL for a page in web server’s document root in your local testing environment is: http://localhost/page_name.php Security

 Anyone that knows your IP address can easily breach your server and change details in such a way that prevents your accessing it yourself and delete any you may have created.  But not to worry, we will rectify this, go to:  http://localhost/security/xamppsecurity.php  You will be redirected to a new page that will allow you to:  setup a password for MySQL  setup a username and password for your XAMPP directory.

16 What is MySQL?

 MySQL is a database server  MySQL is ideal for both small and large applications  MySQL supports standard SQL  MySQL compiles on a number of platforms  MySQL is free to download and use

17 Running and Stopping MySQL

– On Windows

18 – On Linux

 change to /etc/rc.d/init.d/ directory – Mysql start

19 Basic operations

20 21 22 23  Questions ???

24