What is the best way to send data from android studio, to php, to ssh?

What is the best technique to send data from android studio, to php, to ssh? I was told that I should create the php script to listen to a port, and have android studio push data to that port. So Android studio wouldn't have the SSH URL. I was also told to grab the URL of the PHP file in the SSH server and use that, but the url doesn't seem to work. So how should i go about sending info? I was even told to use some java/mysql hybrid "jbdc". I just wanna know how SHOULD I send info from Android studio to a mysql db on a ssh server. or any server type.