I think it is the flexibility of PHP, but this is dangerous because you can easily write a bad code. The solution to this is using frameworks which will force you to write structured code (MVC).
Ruby, on the other hand, didn't become that popular until it has been on rails, although it is an easy-to-learn scripting language. Again it is the framework that improved its popularity.