How to increase password requirements for registration [closed]

Use a hook that fires later and add the $bp global to the function.
Try this:

function bp_password_beefing() {
 global $bp;

 if ( !empty( $_POST['signup_password'] ) )
   if ( strlen( $_POST['signup_password'] ) < 6 )
    $bp->signup->errors['signup_password'] = __( 'Your password needs to be at least 6 characters', 'buddypress' );  
 }
 add_action( 'bp_signup_validate', 'bp_password_beefing');