• Resolved thefallguy

    (@thefallguy)


    I have a fresh WordPress install (6.0). WPPA+ reports
    Database revision: 8203006. WP Charset: UTF-8. Current PHP version: 8.1.7. WPPA+ API Version: 8.2.03.006. Filesystem method: direct
    Multisite enabled. Blogid = 1

    It is a multisite installation. I followed the instructions and added
    define( ‘WPPA_MULTISITE_INDIVIDUAL’, true );
    in wp-config.php

    Now, on every page I view I get the error message

    Warning: Constant WPPA_MULTISITE_INDIVIDUAL already defined in /usr/local/var/www/wordpress/wp-config.php on line 108

    (which is the line where I added the define!)

    Have I done something wrong?

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Jacob N. Breetvelt

    (@opajaap)

    This is very strange. However i made a patch (looking a different way if the constant has been set).

    De-activate and delete the plugin, and re-install as if it is a new plugin.
    You will loose no data or settings.
    Pls tell me if it works.

    Thread Starter thefallguy

    (@thefallguy)

    Jacob,

    Thanks for getting back to me. I deleted the plugin and installed it again. Immediately after Activating the plugin, I get these messages

    Warning: mkdir(): No such file or directory in /usr/local/var/www/wordpress/wp-content/plugins/wp-photo-album-plus/wppa-setup.php on line 533

    Warning: chmod(): No such file or directory in /usr/local/var/www/wordpress/wp-content/plugins/wp-photo-album-plus/wppa-setup.php on line 535

    Warning: Constant WPPA_MULTISITE_INDIVIDUAL already defined in /usr/local/var/www/wordpress/wp-config.php on line 108

    It looks to me as if the Constant warning is a PHP error, implying that it is defined elsewhere… Just a theory

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    What is your php version?

    Thread Starter thefallguy

    (@thefallguy)

    Jacob

    I think I found a coding error at line 80 in wppa.php: it just says

    defined(‘WPPA_MULTISITE_INDIVIDUAL’) or define( ‘WPPA_MULTISITE_INDIVIDUAL’, false );

    I would have expected it to look like the lines above…

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    This was the patch.
    Before it was like the other lines.

    Try to find where the error occurs.
    Is that in wppa.php?

    Dont bother about the other warnings

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    One question: Does it do what it is supposed to do: every blog its own photo system?

    If so, use the plugin editor an change:

    defined('WPPA_MULTISITE_INDIVIDUAL') or define( 'WPPA_MULTISITE_INDIVIDUAL', false );
    
    

    into:

    @ defined('WPPA_MULTISITE_INDIVIDUAL') or define( 'WPPA_MULTISITE_INDIVIDUAL', false );
    
    

    i.e. place an ampersand (@) in front of the statement. This is supposed to suppress errormessages.

    Thread Starter thefallguy

    (@thefallguy)

    Makes no difference!

    It looks like your code is run before wp-config.php, hence, it is not defined, so gets defined, and then wp-config.php runs and thus generates the multiple definition.

    php –version
    PHP 8.1.8 (cli) (built: Jul 8 2022 10:58:31) (NTS)
    Copyright (c) The PHP Group
    Zend Engine v4.1.8, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.8, Copyright (c), by Zend Technologies

    I haven’t tried to see the behaviour, but (given my synopsis above), I doubt it will do what I want. I’ll try that next (in a couple of days – busy tomorrow!)

    Thread Starter thefallguy

    (@thefallguy)

    p.s. my theory is confirmed as, although the setting is made in wp-config.php, I still see the error message (below) when trying to do album admin

    Erro:

    WP Photo ALbum Plus Error message
    
    This is a multi site installation. One of the following 3 lines must be entered in wp-config.php:
    
    define( 'WPPA_MULTISITE_INDIVIDUAL', true );// Multisite WP 3.5 or later with every site its own albums and photos
    define( 'WPPA_MULTISITE_BLOGSDIR', true );// Multisite prior to WP 3.5 with every site its own albums and photos
    define( 'WPPA_MULTISITE_GLOBAL', true );// Multisite with one common set of albums and photos
    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    Make sure it is high up in wp-config.php, i.e. before any include or require or function call.
    I am on my phone now sp i can not give more details. But this could cause the problem

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    So, Warning: Constant WPPA_MULTISITE_INDIVIDUAL already defined in /usr/local/var/www/wordpress/wp-config.php on line 108 means that the error occurs on line 108. Confusing errormessage.

    This means that
    define( ‘WPPA_MULTISITE_INDIVIDUAL’, true );
    is entered after
    require_once ABSPATH . 'wp-settings.php';
    what loads all the stoff, including wppa.php

    define( ‘WPPA_MULTISITE_INDIVIDUAL’, true ); must be entered prior to
    require_once ABSPATH . 'wp-settings.php';

    See wp-config-sample.php:

    /* Add any custom values between this line and the "stop editing" line. */
    
    HERE TO ADD define( ‘WPPA_MULTISITE_INDIVIDUAL’, true );
    
    /* That's all, stop editing! Happy publishing. */
    
    /** Absolute path to the WordPress directory. */
    if ( ! defined( 'ABSPATH' ) ) {
    	define( 'ABSPATH', __DIR__ . '/' );
    }
    
    /** Sets up WordPress vars and included files. */
    require_once ABSPATH . 'wp-settings.php';
    
    Thread Starter thefallguy

    (@thefallguy)

    Thanks. That worked. I should take more notice of the comments in wp-config.php. But, perhaps, you could be a bit more explicit in your instructions?

    Thanks for your help.

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    Yes, that too. The explanation will be more specific in the next version, stating where to add the line.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘WPPA_MULTISITE_INDIVIDUAL already defined’ is closed to new replies.