Still I don't see which deploying a web server and landing the payload to filesystem should be necessary. You can send inject a stager which just reads the php code from an http header and evals it. Send the metasploit payload in the header (in the same request). On modules/exploits/unix/webapp/php_eval.rb a generic example can be found.