You’re talking about mixing php with a Rails application.
It can be done but it’s really painful. Once you are serving Rails apps, any files in the Rails public/ folder need to be called by their full name. So, if you have a PHP script that makes a call to /files/ instead of /files/index.php then it will fail. A fair amount of scripts do that kind of linking.
I would say it’s really not worth it, but if you do decide to try it, good luck, and be sure to blog about it so we can all follow your progress.