The big difference that the PHP ecosystem seems to have vs the ruby/python ecosystems is an emphasis on providing complete stand-alone solutions to problems vs providing developers with the most flexible and powerful tooling to develop their own solutions.
Whenever I find myself wanting a photo-gallery, an eCommerce platform or a forum I always seem to find that the most mature solutions are based on PHP.
The advantage of this is that semi-technical webmasters can easily deploy complete websites without writing a line of code, thus the underlying code quality is of secondary importance to the functionality provided.