I have a couple command line php scripts and also php pages that call the same class file. Instead of having mutiple copies of it floating around, I want to put class.myApi.php in one central location on the filesystem. All files will then reference that one single file. Where does it belong? Does it belong in /usr/bin ?
-
Is this a per-user problem or a global one?XQYZ– XQYZ2011-05-13 14:55:57 +00:00Commented May 13, 2011 at 14:55
-
@XQYZ I don't understand the question. Root uses it in cron (I think) and then whatever Apache user uses it in serving pages.user394– user3942011-05-13 14:57:22 +00:00Commented May 13, 2011 at 14:57
-
Well if it had been a user problem then the location would be in your home. So I was just checking here. It's a difficult question, but since apache uses it anywhere but your www directory seems wrong imho.XQYZ– XQYZ2011-05-13 15:20:22 +00:00Commented May 13, 2011 at 15:20
Add a comment
|
2 Answers
I would suggest either /usr/local/share/php/your-app-name or /opt/local/share/php/your-app-name.
I think the most appropriate place would be
/usr/lib/yourLibraryName
See the Filesystem Hierarchie Standard for more information.
-
2That would be appropriate for packaged files belonging or built for the target distribution. Locally contributed files shouldn't go under /usr (outside /usr/local).jlliagre– jlliagre2011-05-13 21:00:32 +00:00Commented May 13, 2011 at 21:00