What do you think is fundamentally bad about PHP exactly? It powers a large percentage of the web and does it quite well.
If it was written in another language you'd have the same problems with the same architecture.
Wordpress gets exploited because it's popular, not because it's written in PHP