Jump to content

Recommended Posts

Hi guys.

 

Having been around here a little while, this is my first post, so please be gentle!

 

I have a question regarding creating an installer file. For years I've developed web based PHP apps for customers, ranging from simple stock systems to customer databases and booking systems. I've always used XAMPP to install the necessary modules, and then manually created the databases and copied the files into the htdocs folder.

 

I'm now looking at possibly branching out and offering products as standalone purchases, and obviously don't want to have to attend the customer's property each time to set up and install everything. Ideally, I would like to create a standalone Windows based installer that would install PHP, MySQL, create the databases and put the web app into the htdocs folder. In essence, allow a customer to download the application's "installer", which the run through in a standard wizard based format, and then at the end everything is ready to go.

 

Does anyone know if this is possible?

 

Many thanks,

MR

Anything is possible. It depends on what the effort is vs. the benefit. I would think any solution you create is still going to require some hand holding due to environmental issues such as firewalls.

 

XAMPP is fine for a dev environment, but it not advised for a production environment. But, if that is the way you want to go, then just grab a copy of the XAMPP zip file. Then put the files for your application in the htdocs folder within the zip file. You can change the zip file in a self extracting executable (i.e. exe). However, if they choose a location that is not at the root of a drive, there are additional configuration options to make Apache work.

 

As for your application, you would want a script that is executed the first time the site is accessed. You could have a test to see if the site has been configured. E.g.

 

if(file_exists('db_config.php')) { include('first_run.php'); }

. . . or you could test if a configuration file that you create during the first time setup exists.

 

That file can allow the user to enter the DB connection info and a database name to use. Then it will connect to the DB. If successful, save the credentials to a configuration file that will be used by the application. Then it will create the DB and run the initial scripts to create the necessary tables and default data. Then, you might have a process to create the "admin" user for the application. Once setup has been completed, the test to run the first time setup should be skipped based on whatever logic you implemented.

 

This is all very high level. Any "automated" setup would still likely need someone with some technical skills. And, really, it might make more sense to just host the applications yourself and create different "accounts" in your database. That way you also have some protection from your code being distributed to others.

Thanks Psycho, that's all great advice.

 

Having developed PHP applications for quite a while, I've always been involved in the setup process and hosting, but what you're saying all makes sense. I think you hit the nail on the head with questioning effort vs benefit, and ultimately it may well be simpler to host myself. One immediate advantage of course is then access from any internet enabled device instead of just the local LAN.

 

Thanks again.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.