PHP is like democracy
In that it's the worst programming language for the web, except for all of the others.
Perl - I love Perl, but if you want to write code which other people can easily grok, this is not the correct language to do it in.
Java - appeals to enterprise scale application writers perhaps, but the overheads are just too high for typical use cases.
C# - I have a lot of respect for C# as a language, and it's solid for web development, the only problem being that it's a gateway drug leading to Microsoft as a wider environment, which most people don't really want on their webservers.
Ruby / Python / Node.js / Insert name of other trendy contenders - Sure, if you like. But at the moment they all a bit far out to ever see the mainstream appeal of PHP.
So people live with PHP because despite it's quirks and inconsistencies it is fundamentally a relatively sane OO language with syntax which is familiar to anyone with a background in a c-like language.