Different sunrise.php for Multi Domain and Domain Mapping

Hello,

I´ve installed Multi Domain and Domain Mapping.
First Multi Domain and installed the sunrise.php.
After that I´ve installed Domain Mapping and was ask that the sunrise.php is to old. After that I´ve installed the sunrise.pgp from the Domain Mappingpackage.
BUT now the plugin Multi Domain tells me, taht there is no sunrise.php available!
Please copy the content of sunrise.php into /var/www/vhosts/seniorenmobile.de/httpdocs/wp-content/sunrise.php and uncomment the SUNRISE setting in the /var/www/vhosts/seniorenmobile.de/httpdocs/wp-content/wp-config.php file.

  • aristath
    • Recruit

    Hello there @Sven, I hope you're well today!

    Try doing this:
    1. delete the sunrise.php file
    2. deactivate BOTH plugins.
    3. activate the domain mapping plugin.
    4. activate the multidomain plugin
    Try it in THAT ORDER and let me know if that works for you...
    If it does, I'll submit a bug report so that we may fix it no matter the order the plugins are activated.

    I hope that helps!

    Cheers,
    Ari.

  • aristath
    • Recruit

    And what kind of sunrise.php to install after all that?
    from which plugin package?

    If your wp-content folder is writable and you're using the latest versions of both the plugins, then the sunrise.php file should be automatically created, you shouldn't have to do anything.
    Can you please Grant me access to your site so that I may see what exactly is going on?
    To do so, from your dashboard go to WPMUDEV => Support => Support Access and click on the "Grant access" button.

    Cheers,
    Ari.

  • Sven
    • WPMU DEV Initiate

    Hello,

    I give you access.
    CMOD is 755

    But there are 2 different sunrise.php and please read agoin my problem

    First Multi Domain and installed the sunrise.php.
    After that I´ve installed Domain Mapping and was ask that the sunrise.php is to old. After that I´ve installed the sunrise.pgp from the Domain Mappingpackage.
    BUT now the plugin Multi Domain tells me, taht there is no sunrise.php available!

  • Sven
    • WPMU DEV Initiate

    Question, should there be one or tow sunrise.php files under wp-content?
    I have one

    <?php
    
    define( 'DOMAINMAPPING_SUNRISE_VERSION', '1.0.1' );
    
    // domain mapping plugin to handle VHOST and non VHOST installation
    global $wpdb;
    $wpdb->dmtable = ( isset( $wpdb->base_prefix ) ? $wpdb->base_prefix : $wpdb->prefix ) . 'domain_mapping';
    
    if ( defined( 'COOKIE_DOMAIN' ) ) {
    	define( 'COOKIE_DOMAIN_ERROR', true );
    }
    
    $using_domain = $_SERVER['HTTP_HOST'];
    if ( filter_var( $using_domain, FILTER_VALIDATE_IP ) ) {
    	$mapped_id = 1;
    } else {
    	$s_e = $wpdb->suppress_errors();
    
    	// Check for the domain with and without the www. prefix
    	$using_domain = preg_replace( '/^www\./', '', $using_domain );
    	$mapped_id = $wpdb->get_var( $wpdb->prepare( "SELECT blog_id FROM {$wpdb->dmtable} WHERE domain = %s OR domain = %s LIMIT 1", $using_domain, "www.{$using_domain}" ) );
    
    	$wpdb->suppress_errors( $s_e );
    }
    
    if ( !empty( $mapped_id ) ) {
    	$current_blog = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->blogs} WHERE blog_id = %d LIMIT 1", $mapped_id ) );
    	$current_blog->domain = $_SERVER['HTTP_HOST'];
    
    	$blog_id = $mapped_id;
    	$site_id = $current_blog->site_id;
    
    	define( 'COOKIE_DOMAIN', $using_domain );
    
    	$current_site = $wpdb->get_row( $wpdb->prepare( "SELECT * from {$wpdb->site} WHERE id = %d LIMIT 1", $current_blog->site_id ) );
    	$current_site->blog_id = $wpdb->get_var( $wpdb->prepare( "SELECT blog_id FROM {$wpdb->blogs} WHERE domain = %s AND path = %s", $current_site->domain, $current_site->path ) );
    
    	$current_site = get_current_site_name( $current_site );
    	$current_blog->path = $current_site->path;
    
    	define( 'DOMAIN_MAPPING', 1 );
    
    	// Added for belt and braces
    	if ( !defined( 'WP_CONTENT_URL' ) ) {
    		// full url - WP_CONTENT_DIR is defined further up
    		define( 'WP_CONTENT_URL', ( is_ssl() ? 'https://' : 'http://' ) . $current_blog->domain . $current_blog->path . 'wp-content' );
    	}
    }
    
    // clean up temporary variables
    unset( $s_e, $using_domain, $mapped_id );

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.