You can store files where ever you want.
How you access them is also up to you
1 - have a bootstrap php file which includes the library, eg
or you put that same code in one file and symlink to it from each web root.
include("../../app/start.php"); //(or use abs path eg /var/www/common/app/start.php)
$api = new API;
Either way get the benefit from having just one file/library in one place - you just have to decide which you would rather maintain - several identical files which do nothing more than include one file, or a bunch of symlinks?
On some servers the openbase_dir directive will get in the way, but you should be able to over ride this