Preheat your oven to 350°F (175°C) and lightly coat a 9-inch square baking pan with a thin layer of olive oil.
Warm 3 tablespoons of olive oil in a large skillet over medium heat. Add the chopped onion, green onions, and garlic, and sauté until they soften and take on a light golden color, around 5 minutes.
Add the spinach and parsley to the skillet, stirring gently. Cook until the spinach wilts and softens, approximately 2 minutes. Remove from heat and let the mixture cool slightly.
In a medium mixing bowl, combine the crumbled feta, ricotta, and beaten eggs. Stir until thoroughly mixed, then incorporate the cooled spinach mixture, blending until well combined.
Place one sheet of phyllo dough into the prepared baking pan, allowing it to drape over the edges. Lightly brush the sheet with olive oil. Layer a second sheet of phyllo on top, brush with oil, and repeat the process with two more sheets, brushing each layer with oil. The phyllo should overhang the sides of the pan.
Spread the spinach and cheese mixture evenly over the phyllo layers. Fold any overhanging dough over the filling and brush with a bit more oil.
Place the remaining four phyllo sheets on top, brushing each one with olive oil as you layer. Tuck any overhanging dough into the pan to securely enclose the filling.
Bake in the preheated oven for 30 to 40 minutes, or until the phyllo turns golden brown and crisp.
Allow the spanakopita to cool briefly, then cut into squares and serve warm. Enjoy this flavorful, flaky Greek classic!