Welcome to TheCredence.com - You may like to subscribe to our RSS feed to stay updated.

A lot of opensource and free software done in PHP/MySQL does not have an easy way to be installed on the machine.  Usually you have to create several databases, rewrite configuration files and do some complicated things to get the code to work on your server.

With a little planning from the start you can streamline this process and make installing a PHP/MySQL web app a snap for any user who wants to use your code. :)

First, you need to plan ahead on how many tables you want to use in your database.  Keep track of these, and create a simple script with the SQL statements CREATE DATABASE and CREATE TABLE to be run when the program is first installed on the client’s machine.

Another thing to keep in mind is simplicity of structure, and creation of a secure configuration file.  This file should be created by a Graphical interface, and not edited by hand.  Editing by hand creates confusion in some users, and could be damaging to their databases if they don’t know what they are doing.

A good config script is simple and to the point, with any passwords encrypted.  You should keep only the name of the database, the user who has access to this database and the password for accessing this database in this file.

Now, when the user loads the main index.php of your application, it should search the directory for the config.php file.  If it does not exist, it runs the install program.  It should be as simple as possible and as easy to follow as you can, with as little interaction from the user.

Just a field for the database name, a table prefix (in case they want multiple installs), the user with permissions and the user password.  This script would then call the database building script, create the tables that are necessary and then create the correct config file with the data just entered.

As you can see, with a little preparation creating an easy to use installation environment is a snap.

1 Star2 Stars3 Stars4 Stars5 Stars (6 votes, average: 1 out of 5)
Loading ... Loading ...
Subscribe in a reader |

Links you may find interesting -