Tengo un script PHP que necesito para ejecutar como un trabajo cron. Sin embargo, esta secuencia de comandos necesita acceso a la API de WP ( get_pages()
, get_post_meta()
y get_permalink()
específicamente). He seguido las instrucciones en enlace , pero en vano.
Código:
require_once('../../../wp-blog-header.php');
$args = array(
'child_of' => 2083
);
$pages = get_pages($args);
Sin embargo, cuando ejecuto php -q this_file.php
desde la línea de comandos, obtengo el siguiente resultado:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Database Error</title>
</head>
<body>
<h1>Error establishing a database connection</h1>
</body>
</html>
¿Alguien tiene algún comentario o sugerencia?