Biogasification of solid wastes by two-phase anaerobic fermentation