How do I use the login for an external application?
You can install in your drupal site a contrib module which allow you to create an API which can access another modules.

You can use Services module which implements route to allow users login across external sites, and another route to get the current user logged in. 

So you can install this module and enable this routes, and with your php site make http calls to this sites to log in the user and check if he is logged in.