What is the best practice for creating a hosted PHP appliacation

96 views Asked by At

I am currently in the final stages of creating a PHP application which I intend to sell as a hosted application.

The apps is effectively a file manager and does not reply on any DB.

My question is, what would be the best way to go about making this apps hosted.

My initial idea was to have a ZIP file containing the files of the hosted app, then when a user signed up this zip would be extracted to their user folder ( http://domain.com/username ), and the config file within this directory would then be editied to reflect their settings.

Is this overkill? If there more practical ways of doing this?

Any help / suggestions would be much appreciated.

Thanks.

2

There are 2 answers

3
deceze On BEST ANSWER

The last thing you possibly want is to accumulate a new file for each new user, much less a complete new copy of your code base. Just imagine the mess you would will get into if when you need to fix a bug and have 1000 copies of your code base floating around. It's great that your app works without a database, but that's pretty impractical in a multi-user setup.

  • Keep one copy of your code base that all users use.
  • Make that code multi-user aware and dynamically pull its settings from somewhere for each user.
  • The best solution for this somewhere is a database.
0
Jonah On

You shouldn't copy the code for every user. What you want to do is create one instance of the application, and give it the capability to handle multiple users independently. Give it a login system so that users can log in and manage/upload their files.