PhpWebsite.md 1.92 KB
Newer Older
Sergey Lyubka's avatar
Sergey Lyubka committed
1 2 3 4 5
How To Create A PHP Website With Mongoose
===========================================

## 1. Create a directory which will contain your website files. For example, on drive `C:\`, create a directory called `my_website`:

Sergey Lyubka's avatar
Sergey Lyubka committed
6
![screenshot](http://cesanta.com/images/tut_php/tut1.png)
Sergey Lyubka's avatar
Sergey Lyubka committed
7 8 9

## 2. Inside `my_website` directory, create a new file called "index". This will be the default web page shown when the website is visited.

Sergey Lyubka's avatar
Sergey Lyubka committed
10
![screenshot](http://cesanta.com/images/tut_php/tut2.png)
Sergey Lyubka's avatar
Sergey Lyubka committed
11 12 13

## 3. Open index file with your favorite editor (for example, Notepad) and enter some HTML / PHP code:

Sergey Lyubka's avatar
Sergey Lyubka committed
14
![screenshot](http://cesanta.com/images/tut_php/tut3.png)
Sergey Lyubka's avatar
Sergey Lyubka committed
15 16 17

## 4. Save this file as `index.php`:

Sergey Lyubka's avatar
Sergey Lyubka committed
18
![screenshot](http://cesanta.com/images/tut_php/tut4.png)
Sergey Lyubka's avatar
Sergey Lyubka committed
19 20


21
## 5. Download Mongoose executable from http://cesanta.com/mongoose.shtml and copy the executable inside `my_website` directory:
Sergey Lyubka's avatar
Sergey Lyubka committed
22

Sergey Lyubka's avatar
Sergey Lyubka committed
23
![screenshot](http://cesanta.com/images/tut_php/tut5.png)
Sergey Lyubka's avatar
Sergey Lyubka committed
24 25 26

## 6. Double-click mongoose executable. An icon will appear on a system tray in the bottom right corner of the desktop:

Sergey Lyubka's avatar
Sergey Lyubka committed
27
![screenshot](http://cesanta.com/images/tut_php/tut6.png)
Sergey Lyubka's avatar
Sergey Lyubka committed
28

29
## 7. Download PHP 5.3 zip (do NOT download PHP 5.5 cause you might have missing DLLs problem) from http://windows.php.net/download and extract it to `C:\php5` directory:
Sergey Lyubka's avatar
Sergey Lyubka committed
30
![screenshot](http://cesanta.com/images/tut_php/tut7.png)
Sergey Lyubka's avatar
Sergey Lyubka committed
31 32

## 8. Click on the mongoose icon and choose "Edit Settings" menu.:
Sergey Lyubka's avatar
Sergey Lyubka committed
33
![screenshot](http://cesanta.com/images/tut_php/tut8.png)
Sergey Lyubka's avatar
Sergey Lyubka committed
34 35 36

## 9. A settings dialog will appear. Click on `cgi_interpreter` button:

Sergey Lyubka's avatar
Sergey Lyubka committed
37
![screenshot](http://cesanta.com/images/tut_php/tut9.png)
Sergey Lyubka's avatar
Sergey Lyubka committed
38 39 40

## 10. Choose `C:\php5\php-cgi.exe` and click "Save Settings":

Sergey Lyubka's avatar
Sergey Lyubka committed
41
![screenshot](http://cesanta.com/images/tut_php/tut10.png)
Sergey Lyubka's avatar
Sergey Lyubka committed
42 43

## 11. Click on the mongoose icon and choose "Start browser" menu:
Sergey Lyubka's avatar
Sergey Lyubka committed
44
![screenshot](http://cesanta.com/images/tut_php/tut11.png)
Sergey Lyubka's avatar
Sergey Lyubka committed
45 46 47 48


## 12. A browser will popup displaying `index.php`.

Sergey Lyubka's avatar
Sergey Lyubka committed
49
![screenshot](http://cesanta.com/images/tut_php/tut12.png)