Skip to content

Commit 091fc01

Browse files
committed
conectando no mariadb direto...
1 parent 6b9e5b5 commit 091fc01

6 files changed

+62
-13
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# my projects
2+
www/html/

000-default.conf

+5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
ServerAdmin webmaster@localhost
1212
DocumentRoot /var/www/html
1313

14+
<Directory "/var/www/html">
15+
Options +FollowSymlinks +Indexes
16+
AllowOverride all
17+
</Directory>
18+
1419
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
1520
# error, crit, alert, emerg.
1621
# It is also possible to configure the loglevel for particular

README.md

+22
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
# apache-php-mysql-mssql-phpmyadmin
22

3+
Docker && Apache && Php && Mysql && Mssql (FreeTDS) && PhpMyAdmin
4+
5+
## Install
6+
37
```bash
48
docker-compose up -d
59
```
10+
11+
## Document Root
12+
13+
```
14+
www
15+
```
16+
17+
## Server Root
18+
19+
```
20+
localhost:8086
21+
```
22+
23+
## PhpMyAdmin
24+
25+
```
26+
localhost:8087
27+
```

docker-compose.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,23 @@ php:
22
build: .
33
ports:
44
- "8086:80"
5-
- "8088:443"
5+
- "443:443"
66
volumes:
77
- ./www:/var/www/html
88
links:
9-
- db:mysql
9+
- db
1010
db:
1111
image: mariadb
12+
ports:
13+
- "3306:3306"
1214
environment:
15+
MYSQL_USER: root
1316
MYSQL_ROOT_PASSWORD: root
17+
MYSQL_PASSWORD: root
1418
phpmyadmin:
1519
image: corbinu/docker-phpmyadmin
1620
links:
17-
- db:mysql
21+
- db
1822
ports:
1923
- "8087:80"
2024
environment:

www/index-info.php

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
$envVars = [
4+
"DB_PORT_3306_TCP_PORT",
5+
"DB_PORT_3306_TCP_ADDR",
6+
"DB_ENV_MYSQL_USER",
7+
"DB_ENV_MYSQL_DATABASE",
8+
"DB_ENV_MYSQL_PASSWORD",
9+
"DB_ENV_MYSQL_ROOT_PASSWORD",
10+
];
11+
foreach ($envVars as $envVar) {
12+
$envValue = getenv($envVar);
13+
echo nl2br("<b>{$envVar}</b>: {$envValue}\n");
14+
}
15+
16+
echo nl2br("\n");
17+
$link = mysql_connect('db', 'root', 'root') or die('Error: ' . mysql_error());
18+
echo nl2br("Connection successfully completed! (mysql)\n");
19+
mysql_close($link);
20+
21+
$link = mssql_connect('RELEASEK', 'SA', 'XPT2000') or die('Error: ' . mssql_get_last_message());
22+
echo nl2br("Connection successfully completed! (mssql)\n");
23+
mssql_close($link);
24+
25+
echo nl2br("\n");
26+
phpInfo();

www/index.php

-10
This file was deleted.

0 commit comments

Comments
 (0)