At least for the latter the use became mostly unintentional. For PHP, the problem is that it came about at just the right time to be picked up by WordPress and Facebook, hence encrusting itself in most of the web we see.
I dislike WordPress the same way I came to dislike Visual Studio or any other monstrosity. It's a slow, massive, lumbering mess but it's also by the most mature tool for the job it does.
There's no reason to pick up PHP for a new project. Except, I guess if you're just doing simple CRUD and PHP is what you know.
Languages don't matter that much for simple CRUD apps and PHP is a sub par, annoying, inconsistent language that will get the job done.