I don't claim php is wonderful. It just is what it is, a server side templating language. People are always welcome to pick another appropriate tool for the job. But so much of the pain in CS stems from people refusing to learn new tools to accomplish a task in a domain that there current tool isn't suited for.
ORMs for example. People had a strange notion that SQL is difficult and scary. They justified it by claiming that it would make migrating backends easy. In reality SQL is about easiest grammar on the planet and almost no one ever changes their backend. If they do there is almost always some problems that are just made harder by the ORM.
People who don't actually know a language but only a framework in some language make it even worse. I once asked a guy teaching Rails hiw simple a project would have to be before he'd just hand code it instead of using rails. His answer was never. He'd use rails no matter what the project was.
Ruby now that was an unmitigated mistake. Any development paradigme that starts with "everything is a ..." Is a giant mistake.

