The usual way, with SSL running on the web server. PHP and MySQL don't use SSL themselves. If the web server runs SSL, then you can use https:// urls.
If you mean that the web server and mysql server are on different systems and you want to secure that communication, then I don't know. I'd look at a vpn solution.