The winner of the stealmybitcoin[.]com exploit challenge has a remarkably good writeup on the #PHP2Shell exploit process. The PoC clearly explains what's involved in targeting and calibration for any given PHP version/deployment.
github.comGitHub - KillaBoi/StealMyBitcoin-PoC: A public release of the Steal My Bitcoin challengeA public release of the Steal My Bitcoin challenge - KillaBoi/StealMyBitcoin-PoC