The default cf ssh without parameters allows users to access their containers or virtual machine just fine. However, there are limitations to this.
In PHP buildpacks, the default SSH will not load dynamic libraries such as curl. The following commands will resolve this issue by loading the environment into the bash command.
For cf ssh:
cf ssh "<app-name>" -t -c "/tmp/lifecycle/launcher /home/vcap/app bash ''"
For cf v3-ssh (apps deployed using v3-push):
cf v3-ssh "<app-name>" -t -c "/tmp/lifecycle/launcher /home/vcap/app bash ''"
As a reminder, changing contents within the container or virtual machine does not persist. Hence, making persistent changes through SSH is not recommended.