2014-03-07 22:24:37 +08:00
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`:
2014-03-07 22:40:34 +08:00
![screenshot ](http://cesanta.com/images/tut_php/tut1.png )
2014-03-07 22:24:37 +08:00
## 2. Inside `my_website` directory, create a new file called "index". This will be the default web page shown when the website is visited.
2014-03-07 22:40:34 +08:00
![screenshot ](http://cesanta.com/images/tut_php/tut2.png )
2014-03-07 22:24:37 +08:00
## 3. Open index file with your favorite editor (for example, Notepad) and enter some HTML / PHP code:
2014-03-07 22:40:34 +08:00
![screenshot ](http://cesanta.com/images/tut_php/tut3.png )
2014-03-07 22:24:37 +08:00
## 4. Save this file as `index.php`:
2014-03-07 22:40:34 +08:00
![screenshot ](http://cesanta.com/images/tut_php/tut4.png )
2014-03-07 22:24:37 +08:00
2014-03-09 21:13:25 +08:00
## 5. Download Mongoose executable from http://cesanta.com/mongoose.shtml and copy the executable inside `my_website` directory:
2014-03-07 22:24:37 +08:00
2014-03-07 22:40:34 +08:00
![screenshot ](http://cesanta.com/images/tut_php/tut5.png )
2014-03-07 22:24:37 +08:00
## 6. Double-click mongoose executable. An icon will appear on a system tray in the bottom right corner of the desktop:
2014-03-07 22:40:34 +08:00
![screenshot ](http://cesanta.com/images/tut_php/tut6.png )
2014-03-07 22:24:37 +08:00
2014-03-07 22:46:24 +08:00
## 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:
2014-03-07 22:40:34 +08:00
![screenshot ](http://cesanta.com/images/tut_php/tut7.png )
2014-03-07 22:24:37 +08:00
## 8. Click on the mongoose icon and choose "Edit Settings" menu.:
2014-03-07 22:40:34 +08:00
![screenshot ](http://cesanta.com/images/tut_php/tut8.png )
2014-03-07 22:24:37 +08:00
## 9. A settings dialog will appear. Click on `cgi_interpreter` button:
2014-03-07 22:40:34 +08:00
![screenshot ](http://cesanta.com/images/tut_php/tut9.png )
2014-03-07 22:24:37 +08:00
## 10. Choose `C:\php5\php-cgi.exe` and click "Save Settings":
2014-03-07 22:40:34 +08:00
![screenshot ](http://cesanta.com/images/tut_php/tut10.png )
2014-03-07 22:24:37 +08:00
## 11. Click on the mongoose icon and choose "Start browser" menu:
2014-03-07 22:40:34 +08:00
![screenshot ](http://cesanta.com/images/tut_php/tut11.png )
2014-03-07 22:24:37 +08:00
## 12. A browser will popup displaying `index.php`.
2014-03-07 22:40:34 +08:00
![screenshot ](http://cesanta.com/images/tut_php/tut12.png )