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 9af8d62 commit 909d3a7
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions _posts/2024-06-07-wordpress.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,34 @@ vim wp-config.php
![Imagen 223](https://raw.githubusercontent.com/mgrl39/Born2BeRoot/main/steps/b2br_img_223.png)


```bash
$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);

// Comprobar conexión
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();

$update_home = $mysqli->prepare("UPDATE wp_options SET option_value = ? WHERE option_name = 'home'");
$update_home->bind_param('s', $home);
$update_home->execute();

$update_siteurl->close();
$update_home->close();
$mysqli->close();
```
#### 10. Configuración Final de Lighttpd para PHP
Habilita FastCGI y recarga Lighttpd:
Expand Down

0 comments on commit 909d3a7

Please sign in to comment.