Python, JavaScript, Java, C# have all had great longevity, and much more popular, and can do anything that you can do w/ PHP and a whole lot more. Encouraging new programmers to learn PHP is cruel.
Java and C# are not website-first languages and have never been popular on webhosts. They're still very widely used, maybe even growing; certainly I'd bet that both have a better growth rate than PHP at the moment.