Skip to content

Commit 254451e

Browse files
committed
Add example projects
1 parent 69d97ab commit 254451e

File tree

3 files changed

+55
-0
lines changed

3 files changed

+55
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,23 @@
11
# php-docker-env
22
Setup nginx, mysql, memcached & php env by docker
3+
4+
- [Installation](#installation)
5+
- [Usage](#usage)
6+
- [License](#license)
7+
8+
9+
Installation
10+
------------
11+
12+
``` bash
13+
$ git clone git@github.com:moitran/php-docker-env.git
14+
```
15+
16+
Usage
17+
-----
18+
19+
20+
License
21+
-------
22+
23+
This source code is under [MIT License](https://github.com/moitran/php-docker-env/blob/master/LICENSE)

www/site1/index.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
echo "Site1";
4+
echo "</br>";
5+
6+
$servername = "mysql";
7+
$username = "root";
8+
$password = "root";
9+
10+
// Create connection
11+
$conn = new mysqli($servername, $username, $password);
12+
13+
// Check connection
14+
if ($conn->connect_error) {
15+
die("Connection mysql failed: " . $conn->connect_error);
16+
}
17+
echo "Connected mysql successfully";

www/site2/index.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
echo "Site2";
4+
echo "</br>";
5+
6+
$servername = "mysql";
7+
$username = "root";
8+
$password = "root";
9+
10+
// Create connection
11+
$conn = new mysqli($servername, $username, $password);
12+
13+
// Check connection
14+
if ($conn->connect_error) {
15+
die("Connection mysql failed: " . $conn->connect_error);
16+
}
17+
echo "Connected mysql successfully";

0 commit comments

Comments
 (0)