Page 1 of 1

sharing PHP files across multiple Web sites

Posted: Tue Mar 02, 2004 2:09 pm
by pythone
Hello

I would like to support multiple Web sites using the same PHP files.
I have two options here:
1) Duplicate the PHP files for each Web site
2) Share a single copy of the PHP files for all Web sites

Is one option preferable to the other? Will I have performance problems if the files are shared?
What should be my considerations when choosing which option to take?

thanks

Posted: Tue Mar 02, 2004 2:12 pm
by infolock
best option : creating a class for them is always a good choice.. then, just copy the files over to the site you need them on unless they are being served on the same server. if they are on the same server, no need to copy the files over, otherwise you will need to.

Posted: Tue Mar 02, 2004 2:27 pm
by pythone
thanks

so all the Web sites in the same server can share the same classes, but classes must be duplicated across servers. Am I correct?

So the classes will be used as an API?
But what about the PHP files which are using those classes? Do can those be shared or do they need to be duplicated?

sorry about the silly questions, but I am a newbie.

Posted: Tue Mar 02, 2004 4:03 pm
by infolock
if your php class is on the same server, you should be able to point it to the directory unless it's a 3rd party host. in other words, if you run the server, you can just choose the directory since you have root. otherwise, you are gonna have to copy the files into the web directory for whatever user it is that is gonna need to access it.

yes, you can share the classes and you won't get exceptions. the only thing that will give you an exception is if the file is being written to and cannot be read.

no question is a silly question. altho some answers ( like mine ) are silly from time to time.