Mobile app version of vmapp.org
Login or Join
Sherry384

: Sharing CodeIgniter installation between different servers Current situation: I've got 2 different servers, each one hosting its own CI installation, and everything is working fine, except a lot

@Sherry384

Posted in: #Apache #Codeigniter #Php

Current situation: I've got 2 different servers, each one hosting its own CI installation, and everything is working fine, except a lot of code is duplicated (custom libraries, some views, etc)

My goal: keep everything on one of the 2 servers and have the other one access those files, or even better, keep the whole installation on a third server I'm running that I use to serve unparsed PHP file (mostly for include commands) I tried changing the $system variable to the full URL of the third server (http://server.com/ci/system) but that didn't work as planned and returns an error

Is there any way to do this? Using the same /system between installations would be good, being able to share most of the /application folder as well (libraries, some views) would be even better

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Sherry384

1 Comments

Sorted by latest first Latest Oldest Best

 

@Cofer257

Having a server serve unparsed PHP files is a big security hole. It means anyone else would be able to read the code. What happens if you have some files with a password on there?

The other issue is speed: loading so many files (dozens, if not hundreds) from a completely different server would be very slow.

If you were hosting multiple sites on the same server it would be quite easy to do by making the system directory a symbolic link to a common location.

For sites on different servers I think the best method would be to use version control. You could create your own git repo with the shared files, then pull that down on each server. If you update CI or make other changes you commit them then pull the changes down again on each server.

If you are already using git for the sites themselves you can set up that repo as a submodule in your site's repo.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme