Skip to content

Commit

Permalink
Update 2024-06-07-wordpress.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mgrl39 authored Sep 3, 2024
1 parent 909d3a7 commit c8e612c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions _posts/2024-06-07-wordpress.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ vim wp-config.php
![Imagen 223](https://raw.githubusercontent.com/mgrl39/Born2BeRoot/main/steps/b2br_img_223.png)


Para no tener problemas mas adelante, debajo de la configuracion de **DB_COLLATE** (la configuracion justamente anterior) meteremos esto.
Para luego al clonar la maquina que funcione wordpress correctamente. __ESTO ES MUY IMPORTANTE__
```bash
$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);

Expand All @@ -202,14 +204,11 @@ if ($mysqli->connect_error) {
die("Error de conexión:" . $mysqli->connect_error);
}

// Obtener la IP de la máquina
$ip = $_SERVER['SERVER_ADDR'];

// Construir la URL con la IP
$siteurl = 'http://' . $ip;
$home = 'http://' . $ip;

// Actualizar siteurl y home en la base de datos
$update_siteurl = $mysqli->prepare("UPDATE wp_options SET option_value = ? WHERE option_name = 'siteurl'");
$update_siteurl->bind_param('s', $siteurl);
$update_siteurl->execute();
Expand Down

0 comments on commit c8e612c

Please sign in to comment.