Instalación de MU y buddy

Inicio Foros Otros WordPress y similares Multisitio – BuddyPress Instalación de MU y buddy

Este debate contiene 8 respuestas, tiene 4 mensajes y lo actualizó  paburmester hace 9 años, 10 meses.

  • Autor
    Publicaciones
  • #11956

    firnovion
    Participante

    <p>Hola a todos,</p>
    <p>Tengo problemas con la instalación de MU 2.7. Me he creado un subdominio y lo intento instalar ahí. Todo va bien hasta que al entrar en el subdominio me pide que cree el ficher &quot;wp-config.php&quot;. Hasta ahí como cualquier instalación de wordpress. El problema aparece al pulsar el boton de &quot;generar fichero wp-config.php&quot;, ya que al presionarlo no me aparece nada, vuelve a la misma página en lugar de salir la tipica ventanita de configuración.</p>
    <p>Si alguien sabe que puede ser le agradeceria que me ayudaran a instalar MU 2.7 ya que luego quiero ponerle buddy.
    </p>

  • #25673

    imported_Fernando
    Participante

    ¿No te da ningún error ni nada? Es que así a ciegas pueden ser taaaaantas cosas, desde tu navegador, una instalación mal subida, permisos en el servidor, vete a saber.

  • #25679

    firnovion
    Participante

    Realmente es eso, estoy muy perdido porque no entiendo como no me da ningún error ni me dice nada. He probado a crear un wp-config vacio pero es peor, me salen errores hasta que llega el error en el que me comenta que las "tablas no están creadas", normal, no he ejecutado el script de instalacion 🙂

    He probado a modificar permisos y todo eso, pero no se que más puedo hacer. Estoy utilizando MU 2.7, por si te sirve de algo.

  • #25726

    antorome
    Participante

    Buenas,

    he probado a instalarlo y me da el mismo fallo.

    Subes todo al ftp, te vas al directorio de instalación y te pide que configures el wp-config.php (no lo crea). Meto base de datos, user keys, es_ES y lanzo y me da el fallo de que las tablas no existen, podría crearlas a mano pero debe haber algún error.

    Lo mismo es algún error de la versión actual, algo raro…

    También pide que se configuren las siguientes opciones:

    /** The Database Collate type. Don’t change this if in doubt. */
    define(‘DB_COLLATE’, ”);
    define(‘VHOST’, ‘VHOSTSETTING’);
    $base = ‘/blogs/’;
    define(‘DOMAIN_CURRENT_SITE’, ‘http://www.xxxxxx.com/’ );
    define(‘PATH_CURRENT_SITE’, ‘/blogs/’ );
    define(‘BLOGID_CURRENT_SITE’, ‘1’ );

    Intento instalarlo en el subdirectorio /blogs/ de mi dominio y he probado con varias opciones pero nada.

    Esto es el fallo que da:
    Fatal Error
    If your blog does not display, please contact the owner of this site.

    If you are the owner of this site please check that MySQL is running properly and all tables are error free.

    Database Tables Missing.
    Database tables are missing. This means that MySQL is either not running, WPMU was not installed properly, or someone deleted wp_site. You really should look at your database now.

    What do I do now?
    Read the bug report page. Some of the guidelines there may help you figure out what went wrong.
    If you’re still stuck with this message, then check that your database contains the following tables:

    * wp_blogs
    * wp_users
    * wp_usermeta
    * wp_site
    * wp_sitemeta
    * wp_sitecategories

    If you suspect a problem please report it to the support forums but you must include the information asked for in the WPMU bug reporting guidelines!

  • #25828

    firnovion
    Participante

    Eso me pasa a mi tambien cuando intento poner algo en el wp-config, lo malo es que si no se ejecuta el script de instalación no vale de nada preparar un wp-config. Alguien sabe porqué no se ejecuta el script de instalación?

  • #25831

    firnovion
    Participante

    Se me ocurre que una buena forma de solucionar nuestro problema podría ser colgar el script de MySQL de una BD recien creada de una instalación. La idea es que cargamos esa BD y con el WP-config bien puesto no tendríamos que tener problemas. Alguien se ofrece a colganos un Script?

  • #25834

    firnovion
    Participante

    Bueno, encontré el problema y una solución caserita.

    En mi caso he modificado el fichero index-install.php para que me haga la instalación de forma un poco "forzada". Pego el fichero para que podais verlo.
    [code]
    <?php
    // don’t ever call this file directly!
    /*if( strpos( $_SERVER["REQUEST_URI"], ‘index-install.php’ ) ) {
    header( "Location: index.php" );
    exit();
    }

    if( $_SERVER[ ‘HTTP_HOST’ ] == ‘localhost’ ) {
    die( "<h2>Warning!</h2><p>Installing to http://localhost/ is not supported. Please use http://localhost.localdomain/ instead.</p>" );
    }*/

    define(‘WP_INSTALLING’, true);

    $dirs = array( dirname(__FILE__), dirname(__FILE__) . "/wp-content/" );

    function printheader() {
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
    <html xmlns="http://www.w3.org/1999/xhtml"&gt;
    <head>
    <title>WordPress › Installation</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <style media="screen" type="text/css">
    html { background: #f1f1f1; }

    body {
    background: #fff;
    color: #333;
    font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
    margin: 2em auto 0 auto;
    width: 700px;
    padding: 1em 2em;
    -moz-border-radius: 12px;
    -khtml-border-radius: 12px;
    -webkit-border-radius: 12px;
    border-radius: 12px;
    }

    a { color: #2583ad; text-decoration: none; }

    a:hover { color: #d54e21; }

    h1 {
    font-size: 18px;
    margin-bottom: 0;
    }

    h2 { font-size: 16px; }

    p, li {
    padding-bottom: 2px;
    font-size: 13px;
    line-height: 18px;
    }

    code {
    font-size: 13px;
    }

    ul, ol { padding: 5px 5px 5px 22px; }

    #logo { margin: 6px 0 14px 0px; border-bottom: none;}

    .step {
    margin: 20px 0 15px;
    }

    .step input {
    font-size: 18px;
    }

    a.button {
    font-size: 18px;
    }

    .step, th { text-align: left; padding: 0; }

    .submit input, .button, .button-secondary {
    font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
    padding: 5px 7px 7px;
    border: 1px solid #a3a3a3;
    margin-left: 0;
    -moz-border-radius: 3px;
    -khtml-border-radius: 3px;
    -webkit-border-radius: 3px;
    border-radius: 3px;
    color: #246;
    background: #e5e5e5;
    }

    .button-secondary {
    background: #cee1ef;
    }

    .submit input:hover, .button:hover, .button-secondary:hover {
    color: #d54e21;
    border-color: #535353;
    }

    .form-table {
    border-collapse: collapse;
    margin-top: 1em;
    width: 100%;
    }

    .form-table td {
    margin-bottom: 9px;
    padding: 10px;
    border-bottom: 8px solid #fff;
    font-size: 12px;
    }

    .form-table th {
    font-size: 13px;
    text-align: left;
    padding: 16px 10px 10px 10px;
    border-bottom: 8px solid #fff;
    width: 110px;
    vertical-align: top;
    }

    .form-table tr {
    background: #eaf3fa;
    }

    .form-table code {
    line-height: 18px;
    font-size: 18px;
    }

    .form-table p {
    margin: 4px 0 0 0;
    font-size: 11px;
    }

    .form-table input {
    line-height: 20px;
    font-size: 15px;
    padding: 2px;
    margin-bottom:3px;
    }

    h1 {
    border-bottom: 1px solid #dadada;
    clear: both;
    color: #666666;
    font: 24px Georgia, "Times New Roman", Times, serif;
    margin: 5px 0 0 -4px;
    padding: 0;
    padding-bottom: 7px;
    }

    #error-page {
    margin-top: 50px;
    }

    #error-page p {
    font-size: 14px;
    line-height: 16px;
    margin: 25px 0 20px;
    }

    #error-page code {
    font-size: 15px;
    }
    </style>
    </head>
    <body>
    <h1 id="logo">"WordPress</h1>
    <?php
    }

    function filestats( $err ) {
    print "<h2>Server Summary</h2>";
    print "<p>If you post a message to the µ support forum at http://mu.wordpress.org/forums/ then copy and paste the following information into your message:</p>";

    print "<blockquote style=’background: #eee; border: 1px solid #333; padding: 5px;’>";
    print "
    ERROR: $err
    ";
    clearstatcache();
    $files = array( "htaccess.dist", ".htaccess" );

    foreach ( (array) $files as $val ) {
    $stats = @stat( $val );
    if( $stats ) {
    print "<h2>$val</h2>";
    print "    uid/gid: " . $stats[ ‘uid’ ] . "/" . $stats[ ‘gid’ ] . "
    n";
    print "    size: " . $stats[ ‘size’ ] . "
    ";
    print "    perms: " . substr( sprintf(‘%o’, fileperms( $val ) ), -4 ) . "
    ";
    print "    readable: ";
    print is_readable( $val ) == true ? "yes" : "no";
    print "
    ";
    print "    writeable: ";
    print is_writeable( $val ) == true ? "yes" : "no";
    print "
    ";
    } elseif( file_exists( $val ) == false ) {
    print "<h2>$val</h2>";
    print "    FILE NOT FOUND: $val
    ";
    }
    }
    print "";
    }

    function do_htaccess( $oldfilename, $newfilename, $base, $url ) {
    // remove ending slash from $base and $url
    $htaccess = ”;
    if( substr($base, -1 ) == ‘/’) {
    $base = substr($base, 0, -1);
    }

    if( substr($url, -1 ) == ‘/’) {
    $url = substr($url, 0, -1);
    }
    $err = ”;
    if( is_file( $oldfilename ) ) {
    $fp = @fopen( $oldfilename, "r" );
    if( $fp ) {
    while( !feof( $fp ) )
    {
    $htaccess .= fgets( $fp, 4096 );
    }
    fclose( $fp );
    $htaccess = str_replace( "BASE", $base, $htaccess );
    if( touch( $newfilename ) ) {
    $fp = fopen( $newfilename, "w" );
    if( $fp ) {
    fwrite( $fp, $htaccess );
    fclose( $fp );
    } else {
    $err = "could not open $newfilename for writing";
    }
    } else {
    $err = "could not open $newfilename for writing";
    }
    } else {
    $err = "could not open $oldfilename for reading";
    }
    } else {
    $err = "$oldfilename not found";
    }

    if( $err != ” ) {
    print "<h2>Warning!</h2>";
    print "<p>There was a problem creating the .htaccess file. </p>";
    print "<p style=’color: #900′>Error: ";
    if( $err == "could not open $newfilename for writing" ) {
    print "Could Not Write To $newfilename.";
    } elseif( $err == "could not open $oldfilename for reading" ) {
    print "I could not read from $oldfilename. ";
    } elseif( $err == "$oldfilename not found" ) {
    print "The file, $oldfilename, is missing.";
    }
    print "</p>";
    filestats( $err );

    print "<p>Please ensure that the webserver can write to this directory.</p>";
    print "<p>If you use Cpanel then read this post. Cpanel creates files that I need to overwrite and you have to fix that.</p>";
    print "<p>If all else fails then you’ll have to create it by hand:";
    print "

    • Download htaccess.dist to your computer and open it in your favourite text editor.
    • Replace the following text:
      • BASE by ‘$base’
      • HOST by ‘$url’
    • Rename htaccess.dist to .htaccess and upload it back to the same directory.

    ";
    die( "Installation Aborted!" );
    }
    }

    function checkdirs() {
    global $dirs;
    $return = true;

    $errors = array();
    foreach( (array) $dirs as $dir ) {
    if( false == is_writeable( $dir ) ) {
    $errors[] = $dir;
    }
    }

    if( !empty( $errors ) ) {
    ?>
    <h2>Warning!</h2>
    <div style=’border: 1px solid #ccc’>
    <p style=’font-weight: bold; padding-left: 10px’>One or more of the directories must be made writeable by the webserver. You will be reminded to reset the permissions at the end of the install.
    Please chmod 777 <q>directory-name</q> or chown that directory to the user the web server runs as (usually nobody, apache, or www-data)
    Refresh this page when you’re done!
    </p>
    </div>
    <p>Quick fix:
    chmod 777 <?php
    foreach( $errors as $dir ) {
    echo "$dir ";
    }
    ?>

    </p>
    </div>
    <?php
    $return = false;
    }

    if( file_exists( "./.htaccess" ) && is_writeable( "./.htaccess" ) == false ) {
    ?>
    <h2>Warning! .htaccess already exists.</h2>
    <div style=’border: 1px solid #ccc’>
    <p style=’font-weight: bold; padding-left: 10px’>A file with the name ‘.htaccess’ already exists in this directory and I cannot write to it. Please ftp to the server and delete this file from this directory!
    Offending file: <?php echo realpath( ‘.htaccess’ ); ?></p>
    </div>
    <?php
    $return = false;
    }

    return $return;
    }

    function step1() {
    ?>
    <h2>Installing WordPress µ</h2>
    <p>Welcome to WordPress µ. I will help you install this software by asking you a few questions and asking that you change the permissions on a few directories so I can create configuration files and make a directory to store all your uploaded files.</p>
    <p>If you have installed the single-blog version of WordPress before, please note that the WordPress µ installer is different and trying to create the configuration file wp-config.php youself may result in a broken site. It’s much easier to use this installer to get the job done.</p>

    <h2>What do I need?</h2>

    • Access to your server to change directory permissions. This can be done through ssh or ftp for example.
    • A valid email where your password and administrative emails will be sent.
    • An empty MySQL database.Tables are prefixed with wp_ which may conflict with an existing WordPress install.
    • Wildcard dns records if you’re going to use the virtual host functionality. Check the README for further details.

    <?php
    $mod_rewrite_msg = "<p>If the mod_rewrite module is disabled ask your administrator to enable that module, or look at the Apache documentation or elsewhere for help setting it up.</p>";

    if( function_exists( "apache_get_modules" ) ) {
    $modules = apache_get_modules();
    if( in_array( "mod_rewrite", $modules ) == false ) {
    echo "<p>Warning! It looks like mod_rewrite is not installed.</p>" . $mod_rewrite_msg;
    }
    } else {
    ?><p>Please make sure mod_rewrite is installed as it will be activated at the end of this install.</p><?php
    echo $mod_rewrite_msg;
    }

    if( checkdirs() == false ) {
    return false;
    }

    // Create Blogs living area.
    @mkdir( dirname(__FILE__) . "/wp-content/blogs.dir", 0777 );

    $url = stripslashes( "http://&quot;.$_SERVER["SERVER_NAME"] . dirname( $_SERVER[ "SCRIPT_NAME" ] ) );
    if( substr( $url, -1 ) == ‘/’ )
    $url = substr( $url, 0, -1 );
    $base = stripslashes( dirname( $_SERVER["SCRIPT_NAME"] ) );
    if( $base != "/") {
    $base .= "/";
    }

    return true;
    }

    function printstep1form( $dbname = ‘wordpress’, $uname = ‘username’, $pwd = ‘password’, $dbhost = ‘localhost’, $vhost = ‘yes’, $prefix = ‘wp_’ ) {
    $weblog_title = ucfirst( $_SERVER[ ‘HTTP_HOST’ ] ) . ‘ Blogs’;
    $email = ”;
    $hostname = $_SERVER[ ‘HTTP_HOST’ ];
    if( substr( $_SERVER[ ‘HTTP_HOST’ ], 0, 4 ) == ‘www.’ )
    $hostname = str_replace( "www.", "", $_SERVER[ ‘HTTP_HOST’ ] );
    ?>
    <form method=’post’ action=’index-install.php’>
    <input type=’hidden’ name=’action’ value=’step2′ />
    <h2>Blog Addresses</h2>
    <p>Please choose whether you would like blogs for the WordPress µ install to use sub-domains or sub-directories. You can not change this later. We recommend sub-domains.</p>
    <p>
    <label><input type=’radio’ name=’vhost’ value=’yes’ <?php if( $vhost == ‘yes’ ) echo ‘checked="checked"’; ?> /> Sub-domains (like blog1.example.com)</label>
    <label><input type=’radio’ name=’vhost’ value=’no’ <?php if( $vhost == ‘no’ ) echo ‘checked="checked"’; ?> /> Sub-directories (like example.com/blog1</label>
    </p>

    <h2>Database</h2>

    <p>Below you should enter your database connection details. If you’re not sure about these, contact your host.</p>
    <table class="form-table">
    <tr>
    <th scope=’row’ width=’33%’>Database Name</th>
    <td><input name=’dbname’ type=’text’ size=’45’ value='<?php echo $dbname ?>’ /></td>
    </tr>
    <tr>
    <th scope=’row’>User Name</th>
    <td><input name=’uname’ type=’text’ size=’45’ value='<?php echo $uname ?>’ /></td>
    </tr>
    <tr>
    <th scope=’row’>Password</th>
    <td><input name=’pwd’ type=’text’ size=’45’ value='<?php echo $pwd ?>’ /></td>
    </tr>
    <tr>
    <th scope=’row’>Database Host</th>
    <td><input name=’dbhost’ type=’text’ size=’45’ value='<?php echo $dbhost ?>’ /></td>
    </tr>
    </table>

    <h2>Server Address</h2>
    <table class="form-table">
    <tr>
    <th scope=’row’>Server Address</th>
    <td>
    <input type=’text’ name=’basedomain’ value='<?php echo $hostname ?>’ />
    <p>What is the Internet address of your site? You should enter the shortest address possible. For example, use example.com instead of http://www.example.com but if you are going to use an address like blogs.example.com then enter that unaltered in the box below.</p>
    <p>Do not use an IP address (like 127.0.0.1) as your server address. Do not use a single word hostname like <q>localhost</q>, use <q>localhost.localdomain</q> instead.</p>
    </td>
    </tr>
    </table>

    <h2>Site Details</h2>
    <table class="form-table">
    <tr>
    <th scope=’row’>Site Title</th>
    <td>
    <input name=’weblog_title’ type=’text’ size=’45’ value='<?php echo $weblog_title ?>’ />

    What would you like to call your site?
    </td>
    </tr>
    <tr>
    <th scope=’row’>Email</th>
    <td>
    <input name=’email’ type=’text’ size=’45’ value='<?php echo $email ?>’ />

    Your email address.
    </td>
    </tr>
    </table>
    <p class=’submit’><input class="button" name=’submit’ type=’submit’ value=’Submit’ /></p>
    </form>
    <?php
    }

    function step2() {
    global $base, $wpdb;

    $dbname = stripslashes($_POST[‘dbname’]);
    $uname = stripslashes($_POST[‘uname’]);
    $passwrd = stripslashes($_POST[‘pwd’]);
    $dbhost = stripslashes($_POST[‘dbhost’]);
    $vhost = stripslashes($_POST[‘vhost’ ]);
    $prefix = ‘wp_’; // Hardcoded

    $base = stripslashes( dirname($_SERVER["SCRIPT_NAME"]) );
    if( $base != "/")
    $base .= "/";

    // Test the db connection.
    define(‘DB_NAME’, $dbname);
    define(‘DB_USER’, $uname);
    define(‘DB_PASSWORD’, $passwrd);
    define(‘DB_HOST’, $dbhost);

    if (!file_exists(‘wp-config-sample.php’))
    die(‘Sorry, I need a wp-config-sample.php file to work from. Please re-upload this file from your WordPress installation.’);

    $wp_config_file = file(‘wp-config-sample.php’);
    // We’ll fail here if the values are no good.
    require_once(‘wp-includes/wp-db.php’);
    printheader();

    $handle = fopen(‘wp-config.php’, ‘w’);

    foreach ($wp_config_file as $line) {
    switch ( trim( substr($line,0,16) ) ) {
    case "define(‘DB_NAME’":
    fwrite($handle, str_replace("wordpress", $dbname, $line));
    break;
    case "define(‘DB_USER’":
    fwrite($handle, str_replace("’username’", "’$uname’", $line));
    break;
    case "define(‘DB_PASSW":
    fwrite($handle, str_replace("’password’", "’$passwrd’", $line));
    break;
    case "define(‘DB_HOST’":
    fwrite($handle, str_replace("localhost", $dbhost, $line));
    break;
    case "define(‘VHOST’,":
    fwrite($handle, str_replace("VHOSTSETTING", $vhost, $line));
    break;
    case ‘$table_prefix =’:
    fwrite($handle, str_replace(‘wp_’, $prefix, $line));
    break;
    case ‘$base = ‘BASE’;’:
    fwrite($handle, str_replace(‘BASE’, $base, $line));
    break;
    case "define(‘DOMAIN_C":
    $domain = get_clean_basedomain();
    fwrite($handle, str_replace("current_site_domain", $domain, $line));
    break;
    case "define(‘PATH_CUR":
    fwrite($handle, str_replace("current_site_path", str_replace( ‘index.php’, ”, $_SERVER[ ‘REQUEST_URI’ ] ), $line));
    break;
    case "define(‘AUTH_KEY":
    case "define(‘AUTH_SAL":
    case "define(‘LOGGED_I":
    case "define(‘SECURE_A":
    case "define(‘NONCE_KE":
    fwrite($handle, str_replace(‘put your unique phrase here’, md5( mt_rand() ) . md5( mt_rand() ), $line));
    break;
    default:
    fwrite($handle, $line);
    break;
    }
    }
    fclose($handle);
    chmod(‘wp-config.php’, 0644);
    define( ‘VHOST’, $vhost );
    }

    function get_clean_basedomain() {
    global $wpdb;
    $domain = $wpdb->escape( $_POST[ ‘basedomain’ ] );
    $domain = str_replace( ‘http://’, ”, $domain );
    if( substr( $domain, 0, 4 ) == ‘www.’ )
    $domain = substr( $domain, 4 );
    if( strpos( $domain, ‘/’ ) )
    $domain = substr( $domain, 0, strpos( $domain, ‘/’ ) );
    return $domain;
    }

    function step3() {
    global $wpdb, $current_site, $dirs, $wpmu_version;
    $base = stripslashes( dirname( $_SERVER["SCRIPT_NAME"] ) );
    if( $base != "/") {
    $base .= "/";
    }
    $domain = get_clean_basedomain();
    $email = $wpdb->escape( $_POST[ ‘email’ ] );
    if( $email == ” )
    die( ‘You must enter an email address!’ );

    // set up site tables
    $wpdb->query( "INSERT INTO ".$wpdb->sitemeta." (meta_id, site_id, meta_key, meta_value) VALUES (NULL, 1, ‘site_name’, ‘" . $wpdb->escape( $_POST[ ‘weblog_title’ ] ) . "’)" );
    $wpdb->query( "INSERT INTO ".$wpdb->sitemeta." (meta_id, site_id, meta_key, meta_value) VALUES (NULL, 1, ‘admin_email’, ‘".$email."’)" );
    $wpdb->query( "INSERT INTO ".$wpdb->sitemeta." (meta_id, site_id, meta_key, meta_value) VALUES (NULL, 1, ‘admin_user_id’, ‘1’)" );
    $wpdb->query( "INSERT INTO ".$wpdb->sitemeta." (meta_id, site_id, meta_key, meta_value) VALUES (NULL, 1, ‘registration’, ‘none’)" );
    $wpdb->query( "INSERT INTO ".$wpdb->site." ( id, domain, path ) VALUES ( NULL, ‘$domain’, ‘$base’ )" );
    $wpdb->query( "INSERT INTO " . $wpdb->sitecategories . " ( cat_ID, cat_name, category_nicename, last_updated ) VALUES (1, ‘Uncategorized’, ‘uncategorized’, NOW())" );
    $wpdb->query( "INSERT INTO " . $wpdb->sitecategories . " ( cat_ID, cat_name, category_nicename, last_updated ) VALUES (2, ‘Blogroll’, ‘blogroll’, NOW())" );
    $wpdb->query( "INSERT INTO ".$wpdb->sitemeta." (meta_id, site_id, meta_key, meta_value) VALUES (NULL, 1, ‘upload_filetypes’, ‘jpg jpeg png gif mp3 mov avi wmv midi mid pdf’ )" );
    $wpdb->query( "INSERT INTO ".$wpdb->sitemeta." (meta_id, site_id, meta_key, meta_value) VALUES (NULL, 1, ‘blog_upload_space’, ’10’ )" );
    $wpdb->query( "INSERT INTO ".$wpdb->sitemeta." (meta_id, site_id, meta_key, meta_value) VALUES (NULL, 1, ‘fileupload_maxk’, ‘1500’ )" );
    $wpdb->query( "INSERT INTO ".$wpdb->sitemeta." (meta_id, site_id, meta_key, meta_value) VALUES (NULL, 1, ‘site_admins’, ‘" . serialize( array( ‘admin’ ) ) . "’ )" );
    $wpdb->query( "INSERT INTO ".$wpdb->sitemeta." (meta_id, site_id, meta_key, meta_value) VALUES (NULL, 1, ‘allowedthemes’, ‘" . serialize( array( ‘classic’ => 1, ‘default’ => 1 ) ) . "’ )" );
    $wpdb->query( "INSERT INTO ".$wpdb->sitemeta." (meta_id, site_id, meta_key, meta_value) VALUES (NULL, 1, ‘illegal_names’, ‘" . serialize( array( "www", "web", "root", "admin", "main", "invite", "administrator" ) ) . "’ )" );
    $wpdb->query( "INSERT INTO ".$wpdb->sitemeta." (meta_id, site_id, meta_key, meta_value) VALUES (NULL, 1, ‘welcome_email’, ‘Dear User,

    Your new SITE_NAME blog has been successfully set up at:
    BLOG_URL

    You can log in to the administrator account with the following information:
    Username: USERNAME
    Password: PASSWORD
    Login Here: BLOG_URLwp-login.php

    We hope you enjoy your new blog.
    Thanks!

    –The Team @ SITE_NAME’)" );
    $wpdb->query( "INSERT INTO ".$wpdb->sitemeta." (meta_id, site_id, meta_key, meta_value) VALUES (NULL, 1, ‘first_post’, ‘Welcome to SITE_NAME. This is your first post. Edit or delete it, then start blogging!’ )" );
    $weblog_title = stripslashes( $_POST[ ‘weblog_title’ ] );

    $pass = substr( md5( rand() ), 5, 12 );
    $user_id = wpmu_create_user( ‘admin’, $pass, $email);

    $current_site->domain = $domain;
    $current_site->path = $base;
    $current_site->site_name = ucfirst( $domain );

    wpmu_create_blog( $domain, $base, $weblog_title, $user_id, array( ‘blog_public’ => 1, ‘public’ => 1 ) );
    update_blog_option( 1, ‘template’, ‘home’);
    update_blog_option( 1, ‘stylesheet’, ‘home’);

    if( constant( ‘VHOST’ ) == ‘yes’ ) {
    update_blog_option( 1, ‘permalink_structure’, ‘/%year%/%monthnum%/%day%/%postname%/’);
    } else {
    update_blog_option( 1, ‘permalink_structure’, ‘/blog/%year%/%monthnum%/%day%/%postname%/’);
    }

    update_blog_option( 1, ‘rewrite_rules’, ”);

    $msg = "Your new WordPress MU site has been created atnhttp://{$domain}{$base}nnLogin details:nUsername: adminnPassword: $passnLogin: http://{$domain}{$base}wp-login.phpn";
    wp_mail( $email, "Your new WordPress MU site is ready!", $msg, "From: [email protected]" . $_SERVER[ ‘HTTP_HOST’ ] );
    ?>
    <h2>Installation Finished!</h2>
    <p>Congratulations!
    Your ‘>WordPress µ site has been configured.</p>
    <p>You can log in using the username "admin" and password <?php echo $pass; ?></p>

    <h2>Directory Permissions</h2>
    <p>Please remember to reset the permissions on the following directories:

      <?php
      reset( $dirs );
      foreach( (array) $dirs as $dir ) {
      echo "

    • $dir
    • ";
      }
      ?>

    </p>
    <p>You can probably use the following command to fix the permissions but check with your host if it doubt:

    chmod 755 
    <?php
    reset( $dirs );
    foreach( (array) $dirs as $dir ) {
    echo "$dir ";
    }
    ?>

    </p>

    <h2>Further reading</h2>
    <p>

    • If you run into problems, please search the WordPress µ Forums where you will most likely find a solution. Please don’t post there before searching. It’s not polite.
    • There is also the WordPress µ Trac. That’s our bug tracker.

    </p>
    <p>Thanks for installing WordPress µ!

    Donncha
    wpmu version: <?php echo $wpmu_version ?></p>
    <?php
    }

    function nowww() {
    $nowww = str_replace( ‘www.’, ”, $_POST[ ‘basedomain’ ] );
    ?>
    <h2>No-www</h2>
    <p>WordPress µ strips the string "www" from the URLs of sites using this software. It is still possible to visit your site using the "www" prefix with an address like <?php echo $_POST[ ‘basedomain’ ] ?> but any links will not have the "www" prefix. They will instead point at <?php echo $nowww ?>.</p>
    <p>The preferred method of hosting blogs is without the "www" prefix as it’s more compact and simple.</p>
    <p>You can still use "<?php echo $_POST[ ‘basedomain’ ] ?>" and URLs like "www.blog1.<?php echo $nowww; ?>" to address your site and blogs after installation but internal links will use the <?php echo $nowww ?> format.</p>

    <p>www. is depreciated has a lot more information on why ‘www.’ isn’t needed any more.</p>
    <p>
    <form method=’post’>
    <input type=’hidden’ name=’dbname’ value='<?php echo $_POST[ ‘dbname’ ]; ?>’ />
    <input type=’hidden’ name=’uname’ value='<?php echo $_POST[ ‘uname’ ]; ?>’ />
    <input type=’hidden’ name=’pwd’ value='<?php echo $_POST[ ‘pwd’ ]; ?>’ />
    <input type=’hidden’ name=’dbhost’ value='<?php echo $_POST[ ‘dbhost’ ]; ?>’ />
    <input type=’hidden’ name=’vhost’ value='<?php echo $_POST[ ‘vhost’ ]; ?>’ />
    <input type=’hidden’ name=’weblog_title’ value='<?php echo $_POST[ ‘weblog_title’ ]; ?>’ />
    <input type=’hidden’ name=’email’ value='<?php echo $_POST[ ‘email’ ]; ?>’ />
    <input type=’hidden’ name=’action’ value=’step2′ />
    <input type=’hidden’ name=’basedomain’ value='<?echo $nowww ?>’ />
    <input class="button" type=’submit’ value=’Continue’ />
    </form>
    </p>
    <?php
    }

    $action = isset($_POST[ ‘action’ ]) ? $_POST[ ‘action’ ] : null;
    switch($action) {
    case "step2":
    if( substr( $_POST[ ‘basedomain’ ], 0, 4 ) == ‘www.’ ) {
    printheader();
    nowww();
    continue;
    }

    // get blog username, create wp-config.php
    step2();

    // Install Blog!
    include_once(‘./wp-config.php’);
    include_once(‘./wp-admin/includes/upgrade.php’);

    $_SERVER[ ‘HTTP_HOST’ ] = str_replace( ‘www.’, ”, $_SERVER[ ‘HTTP_HOST’ ] ); // normalise hostname – no www.
    make_db_current_silent();
    populate_options();
    global $base;
    do_htaccess( ‘htaccess.dist’, ‘.htaccess’, $base, ”);

    step3();
    break;
    default:
    // check that directories are writeable, create wpmu-settings.php and get db auth info
    printheader();
    if( step1() ) {
    printstep1form();
    }
    break;
    }
    ?>

    <div style="text-align:center;">
    WordPress µ | Support Forums
    </div>
    </body>
    </html>[/code]

    Una vez puesto esto en el server te va a dejar instalarlo. El siguiente paso es modificar un pelin el wp-admin.php. Basicamente asegurate de que esta línea queda así:
    [code]define(‘PATH_CURRENT_SITE’, ‘/’ );[/code]

    y con eso hecho así yo ya estoy instalando buddy, si hay novedades os escribo.

  • #25946

    paburmester
    Participante

    Hola firnovion, tengo el mismo problema que tu y recien he probado la solucion que publicaste pero no me funciona. Alguna idea de porque?
    Saludos

  • #25948

    paburmester
    Participante

    Al parecer este problema se da cuando tenemos en WPMu en un subdominio y en nuestro root principal tenemos instalado WordPress. La solución más facil es quitar los archivos del root por unos instantes mientras hacemos la instalación de WPMu. Al parecer la instalación de Mu en algún momento sube un directorio y esto es lo que genera este conflicto. Espero les sea de ayuda!
    Saludos,

El foro ‘Multisitio – BuddyPress’ está cerrado y no se permiten nuevos debates ni respuestas.

Pin It on Pinterest

Ir al contenido