For a PHP script, set the permissions to 0644. Nothing should ever have mode 777, as this gives everyone write access. Also, PHP scripts aren't executed as commands by the webserver (they're passed to the PHP interpreter), so no need to set the execute bits.
The message about the missing...