Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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 ?

share|improve this question
    
Is this a per-user problem or a global one? –  XQYZ May 13 '11 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 May 13 '11 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 May 13 '11 at 15:20
add comment

2 Answers 2

up vote 2 down vote accepted

I would suggest either /usr/local/share/php/your-app-name or /opt/local/share/php/your-app-name.

share|improve this answer
add comment

I think the most appropriate place would be

/usr/lib/yourLibraryName

See the Filesystem Hierarchie Standard for more information.

share|improve this answer
1  
That 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 May 13 '11 at 21:00
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.