What makes Ruby, Python and Perl more secure than PHP? Frameworks? PHP has plenty of options there.
PHP is popular because of how easy it was to get started and how available it was in every dirt cheap shared hosting plan on the market. Sure, it's not the most elegant language and it does have plenty of issues but quite a few of these are solved with quality planning and the use of quality tools such as CodeIgnitor or CakePHP.
The low barriers to entry are what made PHP popular and the fact that you can code something robust and maintainable are allowing it to sustain.