Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 9e13de5

Browse files
Error establishing a database connection
I got stuck on this error for like 4/5 days The error: "Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /var/www/wordpress/wp-includes/class-wpdb.php on line 1987" cf. screenshots/
1 parent 5fa1f51 commit 9e13de5

File tree

8 files changed

+113
-16
lines changed

8 files changed

+113
-16
lines changed

‎Makefile‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# By: TheTerror <jfaye@student.42lyon.fr> +#+ +:+ +#+ #
77
# +#+#+#+#+#+ +#+ #
88
# Created: 2024年03月20日 15:35:44 by TheTerror #+# #+# #
9-
# Updated: 2024/03/29 16:37:04 by TheTerror ### ########lyon.fr #
9+
# Updated: 2024/04/01 17:34:33 by TheTerror ### ########lyon.fr #
1010
# #
1111
# **************************************************************************** #
1212

@@ -57,7 +57,7 @@ kill k : # Force stop service containers.
5757
-sudo docker-compose -f $(COMPOSE_FILE) kill --remove-orphans
5858

5959

60-
clean c : down rm rmi
60+
clean c : down rm rmi rmv
6161
fclean fc : clean
6262
-yes | sudo docker system prune
63-
re : down all
63+
re : clean all
85 KB
Loading[フレーム]

‎srcs/docker-compose.yml‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ services:
1111
env_file: ./.env
1212
networks:
1313
- inception
14-
# ports: 8080:443
15-
restart: on-failure
14+
# restart: on-failure
1615

1716
wordpress:
1817
image: wordpress_i
@@ -28,7 +27,7 @@ services:
2827
- wordpress:/var/www/
2928
networks:
3029
- inception
31-
restart: on-failure
30+
#restart: on-failure
3231

3332
nginx:
3433
image: nginx_i
@@ -44,7 +43,7 @@ services:
4443
- inception
4544
ports:
4645
- 8080:443
47-
restart: on-failure
46+
#restart: on-failure
4847

4948
volumes:
5049
wordpress:

‎srcs/requirements/mariadb/Dockerfile‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
### HOST COUCHE ###
2-
FROM debian:bullseye
2+
FROM debian:11
33

44
### APT UPDATE && INSTALL mariadb-server ###
5-
RUN apt update && apt upgrade -y
5+
RUN apt update -y && apt upgrade -y
66

77
RUN apt install mariadb-server -y
88

‎srcs/requirements/nginx/Dockerfile‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
###HOST COUCHE###
2-
FROM debian:bullseye
2+
FROM debian:11
33

44
###APT UPDATE###
5-
RUN apt update
5+
RUN apt update -y
66

77

88
RUN mkdir -p /var/www/

‎srcs/requirements/wordpress/Dockerfile‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
###HOST COUCHE###
2-
FROM debian:bullseye
2+
FROM debian:11
33

44
###APT UPDATE###
5-
RUN apt update && apt upgrade
5+
RUN apt update -y && apt upgrade -y
66

77
RUN mkdir -p /var/www/
88

@@ -18,7 +18,7 @@ RUN rm -rf /var/www/wp_package.tar.gz
1818
RUN mkdir /var/www/jfaye/
1919

2020
COPY ./conf/www.conf /etc/php/7.4/fpm/pool.d/www.conf
21-
#COPY ./conf/wp-config.php /var/www/wordpress/wp-config.php
21+
COPY ./conf/wp-config.php /var/www/wordpress/wp-config.php
2222
# RUN rm -rf /var/www/wordpress/wp-config-sample.php
2323
COPY ./conf/script.sh /.
2424

‎srcs/requirements/wordpress/conf/wp-config.php‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@
7979
*
8080
* @link https://wordpress.org/documentation/article/debugging-in-wordpress/
8181
*/
82-
define( 'WP_DEBUG', false );
82+
define( 'WP_DEBUG', true );
83+
define( 'WP_DEBUG_LOG', true );
8384

8485
/* Add any custom values between this line and the "stop editing" line. */
8586

@@ -89,7 +90,7 @@
8990

9091
/** Absolute path to the WordPress directory. */
9192
if ( ! defined( 'ABSPATH' ) ) {
92-
define( 'ABSPATH', __DIR__ . '/var/www/' );
93+
define( 'ABSPATH', __DIR__ . '/' );
9394
}
9495

9596
/** Sets up WordPress vars and included files. */
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
<?php
2+
/**
3+
* The base configuration for WordPress
4+
*
5+
* The wp-config.php creation script uses this file during the installation.
6+
* You don't have to use the web site, you can copy this file to "wp-config.php"
7+
* and fill in the values.
8+
*
9+
* This file contains the following configurations:
10+
*
11+
* * Database settings
12+
* * Secret keys
13+
* * Database table prefix
14+
* * ABSPATH
15+
*
16+
* @link https://wordpress.org/documentation/article/editing-wp-config-php/
17+
*
18+
* @package WordPress
19+
*/
20+
21+
// ** Database settings - You can get this info from your web host ** //
22+
/** The name of the database for WordPress */
23+
define( 'DB_NAME', 'wordpress_db' );
24+
25+
/** Database username */
26+
define( 'DB_USER', 'jfaye' );
27+
28+
/** Database password */
29+
define( 'DB_PASSWORD', 'mypass' );
30+
31+
/** Database hostname */
32+
define( 'DB_HOST', 'localhost:3306' );
33+
34+
/** Database charset to use in creating database tables. */
35+
define( 'DB_CHARSET', 'utf8' );
36+
37+
/** The database collate type. Don't change this if in doubt. */
38+
define( 'DB_COLLATE', '' );
39+
40+
/**#@+
41+
* Authentication unique keys and salts.
42+
*
43+
* Change these to different unique phrases! You can generate these using
44+
* the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}.
45+
*
46+
* You can change these at any point in time to invalidate all existing cookies.
47+
* This will force all users to have to log in again.
48+
*
49+
* @since 2.6.0
50+
*/
51+
define( 'AUTH_KEY', 'NEpVtQi_QtTgB0< 8_?Rzt]]]kk2+xwD[wQch_$G,Sv56-6.JU`V+rMMyf&.`Wvb' );
52+
define( 'SECURE_AUTH_KEY', 'j0~#d@+){YM#B{X~D_z1_VoOPAR?ZdZv6<Aa`3s-pYYl|v,MB*U&mD[H`FDV$]&_' );
53+
define( 'LOGGED_IN_KEY', '`8<!`M:p^~4$-q5H$||>Uf2V8AFYTq9:<6T<]rhr=H-^+-f--+x0+Z$L%h0d|XQX' );
54+
define( 'NONCE_KEY', 'Gys3FQ%L^;dN+5FfmppXF?Ha:Bl5A]|}eilK`D4grT.E%F#+G;.D3-SyR;+XX[11' );
55+
define( 'AUTH_SALT', 'i[T#RQHj{)J!as}_2Z?iv{jQKA?F,(5N_E6j?D^P/j,+@NX 3pFsh5pL_;;,,4P&' );
56+
define( 'SECURE_AUTH_SALT', '-r&`K0ドル_z:[;*I6|nHUO}>,-cz]WYVttF^!N1<X2(Y|2`v9:A}@PCfCH(tG?M7:i' );
57+
define( 'LOGGED_IN_SALT', '3,YdslrtZIp?NK~g9mmNo!x1}I,#|cgGM{ASL!s)2i RC[j=qAsuFzMat+|>Ep]f' );
58+
define( 'NONCE_SALT', 'PDK{$],hyqrg;c/HF5av-tv>H{8xBxYmx7ドル_rl?]ZMH0=2cr0.0IAkaGL Df+?th' );
59+
60+
/**#@-*/
61+
62+
/**
63+
* WordPress database table prefix.
64+
*
65+
* You can have multiple installations in one database if you give each
66+
* a unique prefix. Only numbers, letters, and underscores please!
67+
*/
68+
$table_prefix = 'wp_';
69+
70+
/**
71+
* For developers: WordPress debugging mode.
72+
*
73+
* Change this to true to enable the display of notices during development.
74+
* It is strongly recommended that plugin and theme developers use WP_DEBUG
75+
* in their development environments.
76+
*
77+
* For information on other constants that can be used for debugging,
78+
* visit the documentation.
79+
*
80+
* @link https://wordpress.org/documentation/article/debugging-in-wordpress/
81+
*/
82+
define( 'WP_DEBUG', true );
83+
define( 'WP_DEBUG_LOG', true );
84+
85+
/* Add any custom values between this line and the "stop editing" line. */
86+
87+
88+
89+
/* That's all, stop editing! Happy publishing. */
90+
91+
/** Absolute path to the WordPress directory. */
92+
if ( ! defined( 'ABSPATH' ) ) {
93+
define( 'ABSPATH', __DIR__ . '/' );
94+
}
95+
96+
/** Sets up WordPress vars and included files. */
97+
require_once ABSPATH . 'wp-settings.php';

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /