Since a reverse shell relies on establishing an outbound network connection, implementing aggressive egress (outbound) firewall rules can disrupt the attack pattern entirely.
A netcat shell is fragile. Upgrade it:
Type reset and hit enter. If asked for a terminal type, enter xterm-256color . Reverse Shell Php