Well, i did encounter the same problem a few weeks ago. I found out why the commands where not working like expected. If i remember correctly it has something to do with the fact that the default shell in Kali 2020.4 has changed from Bash to ZSH and that ZSH processes the commands a little bit different. Try to give the ‘stty raw -echo’ and ‘fg’ command in one line like this: ‘stty raw -echo; fg’.
I faced with this problem too and in my case, the problem was the script I was using. Because I was not able to find php-reverese-shell.php in my system, I just copied the code from the Walkthrough PDF and pasted and edited using nano. It took me some time to realize that somehow the file was missing some comment slashes, and I started to think that maybe that was not the only problem with this copy & paste approach. So I ended downloading the file from pentestmonkey.