+updated 'mariadb' service configuration +removed temp. vhost folder
This commit is contained in:
parent
3802fea960
commit
d9246bd7c0
|
@ -9,13 +9,9 @@ services:
|
||||||
- overlay
|
- overlay
|
||||||
environment:
|
environment:
|
||||||
MYSQL_ROOT_PASSWORD: root
|
MYSQL_ROOT_PASSWORD: root
|
||||||
MYSQL_DATABASE: db1
|
MYSQL_DATABASE: vhost
|
||||||
MYSQL_USER: php
|
MYSQL_USER: php
|
||||||
MYSQL_PASSWORD: php-password
|
MYSQL_PASSWORD: 4JB1dtbrIC8pT935
|
||||||
# volumes:
|
|
||||||
# - ./virtual/usr/local/etc/php-fpm.d/www.conf:/usr/local/etc/php-fpm.d/www.conf
|
|
||||||
# - ./virtual/var/log/php-fpm:/var/log/php-fpm
|
|
||||||
# - ./virtual/vhost:/vhost
|
|
||||||
expose:
|
expose:
|
||||||
- '3306'
|
- '3306'
|
||||||
|
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|
||||||
<title>HTML ex</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,23 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
ini_set('display_errors',1);
|
|
||||||
ini_set('display_startup_errors',1);
|
|
||||||
error_reporting(-1);
|
|
||||||
|
|
||||||
try{
|
|
||||||
|
|
||||||
// create instance with arguments + 10sec timeout
|
|
||||||
$pdo = new PDO('mysql:host=mariadb;dbname=db1', 'php', 'php-password', [PDO::ATTR_TIMEOUT => 10]);
|
|
||||||
|
|
||||||
// On signale que tout s'est bien passe
|
|
||||||
echo "Connected to database";
|
|
||||||
|
|
||||||
}catch(Exception $e){
|
|
||||||
// On signale qu'il y a une erreur
|
|
||||||
echo "Cannot connect to database";
|
|
||||||
|
|
||||||
echo "msg: ".$e->getMessage();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
phpinfo();
|
|
Loading…
Reference in New Issue