Tutorials - CCGI Platform > Help Installing PHP-Nuke

Tutorials & FAQs: Scripts: Help Installing PHP-Nuke

If you use your account to run your own website, one feature you might like to add is a Web Portal System. This is a fully featured website ready for you to use as you wish. Our tutorial provides guidance for installing the PHP-Nuke Web software, which is one of the most popular free Web Portal packages available.

Expertise required

You'll be able to install this software very easily if you follow the step-by-step instructions methodically and accurately type what you see.

  • In two places, you will be required to transfer a file to the CGI server machine. If you have a graphical FTP software package, such as CuteFTP, you may use that. Otherwise, you may use a command line interface (instructions given). However, to do this you'll need to know how to bring up a Command Prompt (possibly called a DOS command, or DOS box) on your operating system and how to then change directory.
  • The installation process also requires you to log on to the CGI server machine. Don't worry, all the commands you'll need are given within the tutorial, so even relatively inexperienced users should not be put off.
  • Non-Windows users should have little difficulty in interpreting the instructions for their operating systems. Very little is actually done on the local host, so the procedure is essentially operating system neutral in this respect.


Getting started with PHP-Nuke

Prior to starting, make sure you have activated both MySQL and CGI usage for your account. (The Website Settings link of the Portal provides tools for doing this. If you do not see the MySQL and CGI configuration tools when you select Website settings, you'll need to upgrade to an account type which includes them.)

For simplicity, red text has been used to indicate text which must be entered exactly as shown. Do not alter it at all (unless you know what you are doing).


Using PHP-Nuke with your CGI webspace

Obtaining the PHP-Nuke software

  1. Visit the PHP-Nuke website to obtain the PHP-Nuke software.
  2. Click on the Downloads link located on the left-hand side of the page
  3. Click on the PHP-Nuke menu in the main frame.
  4. Several different packages are available for downloading. Here, we're concerned with first time installation, so we want 'PHP-Nuke'. Place it in any convenient directory on your home PC (essentially, this is just a temporary location from which we may copy it to the CGI server machine).


Transferring the PHP-Nuke package to the CGI server

  1. In this step, we're concerned with placing a copy of the PHP-Nuke zip file onto the PlusNet CGI server.
  2. You use FTP to copy the package to the server. If you have graphical FTP software (such as CuteFTP) you can use that to put it in your home directory on the CGI server. (You'll see there's already a directory called cgi-bin in your home directory - do not put the PHP-Nuke file in this directory, it should go in your home directory). If you don't have a graphical FTP software package (or if you'd like to try the command line for a change) follow the detailed instructions below for using a command line interface. Note that commands are sent by typing the command and then 'sending' it by pressing the Return or Enter key.
  3. Bring up a Command Prompt.
  4. Switch to the directory containing the PHP-Nuke zip file you created earlier.

    drive:\dir> cd <directory name>

    Now FTP the PHP-Nuke file to the CGI server:

    drive:\dir> ftp cshell.plus.net

    Connected to <CGI server name>.
    220 ProFTPD 1.2.10 Server (ProFTPD) [212.159.7.170]
    User (<CGI server name>:(none)):<your username>
    331 Password required for <your username>.
    Password: <your password for the CGI server machine>
    230 User <your username> logged in.
    ftp> bin
    200 Type set to I.
    ftp> prompt
    Interactive mode Off .
    ftp> mput PHP-Nuke*
    200 PORT command successful
    150 Opening BINARY mode data connection for PHP-Nuke-7.6.zip
    226 Transfer complete.
    ftp: 4696062 bytes sent in 0.77Seconds 6090.87Kbytes/sec.
    ftp> quit
    221 Goodbye.
    drive:\dir> (Back at the Windows Command Prompt)

    Keep the Command Prompt window open -- we use it in the next step!


Extracting the software on the CGI server

Your zipped PHP-Nuke package is now in your home directory on the CGI server. You now need to unpack it:

  1. Log on to the CGI server machine using telnet.
  2. If you used graphical FTP software to transfer the package to the CGI server, this is the point at which you need to open a Command Prompt.
    drive:\dir> telnet cshell.plus.net

    [Connecting]
    Linux 2.6.11-PlusNet-cgi (<timestamp>)
    login: <your username>
    Password: <your password for the CGI server machine>

    Last login: <timestamp> from <your username>.plus.com
    username@cshell1 username $


You have now logged on, and you're at a Linux 'shell' prompt (a Linux way of saying 'Command' Prompt). A feature of the shell is that if you write a few letters of a filename and then press the tab key, it will complete the rest of the name, based on the files in the directory. We'll make use of that feature here, so you don't have to remember the full name of the file we're interested in.

Note: Linux systems are case sensitive (i.e. it matters whether you type in upper case or lower case). Use exactly the same case as is shown here, otherwise Linux won't understand. If you type 'php-nuke' this is not the same as 'PHP-Nuke', for example.

Extracting the files from the PHP-Nuke package

  1. The PHP-Nuke zip file extracts itself to the current directory. This isn't really what we want it to do, as it is both messy and could potentially overwrite files you already have. Because of this we'll need to create a temporary directory to extract the files to:
    username@cshell1 username $ mkdir phpnuke
    username@cshell1 username $ cd phpnuke
    username@cshell1 phpnuke $ unzip ../PHP-Nuke<press the tab key, then enter>


  2. You'll see each file listed as it is extracted. When extraction has finished you should now have some directories called 'html', 'sql' and 'upgrades', as well as some text files. The zip file will still be in your home directory.


Setting up the MySQL Database for PHP-Nuke

  1. We now need to set up the MySQL database so it is ready to use PHP-Nuke. Luckily, there is an sql file provided with PHP-Nuke, which makes this fairly easy to do.
    username@cshell1 phpnuke $ cd sql
    username@cshell1 sql $ mysql -h <rumpus or humbug> -u <your mysql username>--password = <your mysql password> <your mysql database> < nuke.sql


Setting up the config.php file

  1. We now need to add the MySQL details to the config.php file so your PHP-Nuke site will be able to access your MySQL database. To do this we need to use a file editor. There are many file editors available on the CGI Platform, this example uses 'nano' as it is the easiest to use.

    username@cshell1 sql $ cd ../html
    username@cshell1 html $ nano config.php

    You then need to scroll down using the arrow keys on your keyboard past the lines starting with the '#' character and change the following values:

    $dbhost = "<rumpus or humbug>";
    $dbuname = "<your mysql username>";
    $dbpass = "<your mysql password>";
    $dbname = "<your mysql database name>";

    Leave the rest of the file as it is, then hold down the Ctrl + X on your keyboard and then release both keys. You will get the following message near the bottom of your screen:

    Save modified buffer (ANSWERING 'No' WILL DESTROY CHANGES) ? y
    File Name to Write: config.php

    You then just need to press the Enter key on your keyboard to save the changes you've made.


Deciding on a directory name for your Portal
This step is optional, but it will determine the URL (web address) used to access your PHP-Nuke site (<ccgi.username.plus.com>).

  1. The next part of the URL is the directory name in which the PHP-Nuke software resides. By following these instructions, it is /phpnuke/html, so you would access the PHP-Nuke site with this URL: http://<cgi hostname>/phpnuke/html/.
  2. If you don't like the directory name 'phpnuke/html', now is the time to change it. It is more difficult to change later, although it can be done (the name is stored in the MySQL database). For example, you might prefer to call it 'content', which would then make your Portal's web address: http://<cgi hostname>/content. You could even install it to the root of your CGI space, so the address would just be http://cgi.<username>.username.plus.com.
  3. If you want to change the directory name, you do it from your telnet session. First, you need to change back to the root of your CGI space.
    username@cshell1 html $ cd ..



Installing PHP-Nuke to a particular directory

  1. If you want to change it to a particular name (e.g. 'content') then you'll need to make a new directory to store it in. If you wish to change the web address to the root of your CGI space, skip to the 'Installing to the CGI root' heading.
    username@cshell1 username $ mkdir content
    username@cshell1 username $ cd content

  2. You then need to copy the files across from the html directory into your new directory.
    username@cshell1 content $ cp -r ../phpnuke/html/* .


Installing to the CGI root

  1. To install to the root of your CGI space, you just need to copy the files to your home directory in the CGI server. You should still be in this directory if you have been following this tutorial
    username@cshell1 username $ cp -r phpnuke/html/* .

  2. In the remainder of this tutorial, this directory will be referred to as <PHP-Nuke directory>. If you decided not to change it, type phpnuke/html wherever you see this. (Otherwise type the name you gave the directory e.g. 'content' in the example above).
  3. The web address used to access your PHP-Nuke site (shown as <your PHP-Nuke address> later in this tutorial) is: http://<cgi hostname>/<PHP-Nuke directory>.


Changing the permissions of PHP files

  1. On the new CGI platform, php files must have the permissions set on them so they are executable. To do this issue the following command:
    username@cshell1 <PHP-Nuke directory> $ find . -name "*.php" | xargs chmod u+x

  2. The Pipe character, '|', is found on the backslash key '\' to the left of the 'z' key. It can be entered by holding the shift key whilst pressing '\'.



Setting up the admin account
The next step of the installation is carried out from your web browser on your PC. You browse to <your PHP-Nuke address>/admin.php where you will be asked for a username, email address and password. You'll need these details to change any of the settings on your PHP-Nuke site. Therefore, it is a good idea to make them memorable or to take a note of the details you have entered. Once you have done this you will be asked to log in.

Once you have logged in you may change the settings on the site to whatever you want.

Post-installation tidying-up

  1. The PHP-Nuke zip file will still be sat in your home directory on the CGI server - it is no longer required and can be removed. The space it takes on disk counts towards your allocation, plus you'll have an identical copy on your home machine. You can delete it as follows:
    username@cshell1 username $ cd (move up into the correct directory)
    username@cshell1 username $ rm -f PHP-Nuke*.zip (remove the zip file)

  2. Also, if you have moved the PHP-Nuke directory the original files will still be sat on the server taking up space. Therefore, these can be removed as well.
    username@cshell1 username $ rm -rf phpnuke (Do not do this if you have followed Deciding on a directory name for your Portal, previously)



Disconnecting from the CGI server
You can now exit from telnet:
username@cshell1 username $ exit
logout
Connection to host lost.
drive:\dir> exit (closes the Windows Command Prompt)


Next Steps
You will now have a working, but bare-bones, PHP-Nuke system. Follow these steps to start configuring your site to suit your needs:

  1. Use your browser to access your PHP-Nuke site.
  2. Log on with the administrator username and password you specified in the installation
  3. Go to the the 'Administration Page' by following the link on the front page. From this page all aspects of the site can be configured.


Acknowledgements
This document was originally hosted on the PlusNet Portal, and has been reproduced here at the request of PlusNet Staff.
Original Article by: csogilvie - Edited by: csogilvie