It's common for cacti to lean over due to the weight of the spines and the fact that they grow in a spiral shape. You can help keep your cactus upright by using stakes or dowels to prop it up. However, note that cactus leaning is not strictly related to San Pedro.