How to install PHP & MySQL scripts

Ranked #3,973 in Internet, #218,738 overall

How to install scripts?

This article will walk you through installing many of the well-known scripts such as: Wordpress, Joomla, phpBB, vBulletin and many more. Each of these can be installed in a certain similiar way ( most of them ). As many of the scripts that are basicly built in PHP and MySQL, can be installed pretty easily and quickly. It just needs a few steps to be done correctly. These steps will be covered within this article. There will also be given 2 specific installations to illustrate the use of the "general installation method": for Wordpress and phpBB3.

What's your favourite script?

Which do you use, like or maybe even love?

Loading poll. Please Wait...

Installing scripts in general

The basic steps to install a PHP/MySQL script.

Read this first! Before continueing to the script specific installation make sure you understood the steps that are involved in installing scripts, which are explained below. Als note that these steps are involved for installing most of the php/mysql built scripts ( wordpress, phpBB3, vBulletin, SMF, joomla, etc. ) but a very few scripts may require a different way of installing, however here we're looking at the most common way of installing regular PHP/MYSQL-built scripts which will work for most of them.

Most of these scripts consist of a system ( e.g. programmed in PHP ) and a database ( interacted with using MySQL ). To install such script, a few common steps can be walked through. First, after having downloaded and extracted your script (right-click the file, then select "extract all", if you do not have any software to extract zip-files with: consider winrar or winzip) , you'll need to make sure you have the following stuff checked:


  • Check whether there's an automated install file for the script ( e.g. install.php or install/install.php ). If this is the case, you'll only need to do step 1 & step 2 and run the install.php file of your script, in the browser right away!

  • Find out whether there's a SQL file ( e.g. database.sql ) which contains the database for the script (if any).

  • Find the configuration file for the MySQL setup for the script ( e.g. config.php ).

When you checked each of these points, go through the following steps to install your script:


  1. Upload the script.
    If you're running a webserver on your own PC at home ( e.g. using XAMPP ) you can just put it in your public directory ( e.g. C:/xampp/htdocs ) and run the webserver. Otherwise you'll need to upload it to your webhost. To do this you need your FTP info ( get it from your webhost ) and you'll need a FTP software, e.g. FileZilla FTP. Run the FTP software, fill in your FTP info from your webhost account and connect to your website's public directory ( e.g. htdocs or www ). Next: drag the files from your pc ( the extracted script ) to the public folder in FileZilla to upload it to that directory.

  2. Create the MySQL Database & Database User.
    If your script requires a MySQL database, create it. Otherwise continue to step 5. To do so you can access your webhost's admin panel ( e.g. cPanel is a common used one ). To do so you need the url to access it and your login info from your webhost. You can then go to MySQL Databases > Create Database and create a database with any name you like. Now create a database user: Databases > Create User and set a username and password for the user, create it and assign it to your database.

  3. Import the SQL.
    Access your just created database by ( for example ) going to phpmyadmin from your webhost's admin panel. If your webhost uses any other database management software than phpmyadmin, that's no problem but as phpmyadmin is the most common one, we'll assume we're using that software here. When you've opened phpmyadmin, go to Import SQL and select the SQL file ( e.g. database.sql ) that you found with your script.

  4. Update the config file.
    We'll now need to update the config of the script for the MySQL database configuration. Open the file you've found to be the config file for the MySQL connection ( e.g. database.php or config.php ) with notepad. Now find the variables containing the info ( e.g. $database_name = "database name here" ) and enter the correct value inbetween of the quotes ( according to your MySQL info and database name ). An example of a config file:

    config.php

    <?php
    $config['Database']['dbname'] = 'your_database_name_here';

    [...]

    $config['MasterServer']['servername'] = 'server_name_here';

    [...]

    $config['MasterServer']['username'] = 'db_user_name_here';
    $config['MasterServer']['password'] = 'db_user_pass_here';

    Some scripts may use definements instead of variables, then it may look like this:

    wp-config.php

    define('DB_NAME', 'your_database_name_here');

    /** MySQL database username */
    define('DB_USER', 'db_user_name_here');

    /** MySQL database password */
    define('DB_PASSWORD', 'db_user_pass_here');

    /** MySQL hostname */
    define('DB_HOST', 'db_host_name_here');


  5. Enjoy your newly installed script!

If your script is a phpBB3 or Wordpress script, you may continue to its script specific installation section below.

How to install Wordpress

Readme! Some of these steps are explained in the section "Installing scripts in general", if you haven't read that yet it's recommended that you do so before continueing with any of the specific script installations.


  1. Download wordpress.

  2. Extract the files (unzip) in one map.

  3. Upload the script.

  4. Create the MySQL Database & Database User.

  5. Update the config file & continue to step 6 OR continue to step 6 already and create it through the wordpress installation.

    wp-config-sample.php -> rename to -> wp-config.php
    (open with notepad to edit)

    define('DB_NAME', 'your_database_name_here');

    /** MySQL database username */
    define('DB_USER', 'db_user_name_here');

    /** MySQL database password */
    define('DB_PASSWORD', 'db_user_pass_here');

    /** MySQL hostname */
    define('DB_HOST', 'db_host_name_here');

    OR:


    Fill it in through the installation ( next step, preview shown above ).

  6. Install the script
    by running it in your web browser ( e.g. http://localhost/path/to/wordpress/ or http://yourwebsite.com/path/to/wordpress )






  7. Enjoy your newly installed script!

How to install phpBB3


  1. Download phpBB3.

  2. Extract the files (unzip) in one map.

  3. Upload the script.

  4. Create the MySQL Database & Database User.

  5. Run the installation through your webbrowser.
    E.g. go to http://yourwebsite.com/path/to/phpBB3 or http://localhost/path/to/phpBB3. Preview shown below.





  6. Enjoy your newly installed script!

Note: Do make sure the following directories uploaded are chmod'ed to 777: files, cache, store and images/avatars/upload. This can be done by running your FTP software ( e.g. FileZilla ), connecting to your webhost with your FTP login info ( should be provided by your webhost ) and right-click the map -> chmod and set it to 777 for the above mentioned directories/maps.

You might also like ...

Loading

Comments & Questions

  • Jimformation Aug 9, 2011 @ 9:31 am | delete
    Very handy. And a good reference. Thanks!
  • webcodez Aug 18, 2011 @ 7:16 am | delete
    I'm glad you liked it! :)

by

webcodez

"Give a man a program and you'll frustrate him for one day. Teach a man to program and you'll frustrate him for a whole lifetime."

webcodez
GameHeroes
more »

Feeling creative? Create a Lens!