Installing PHP-Nuke


If you're already accustomed to the lengthy process involved with most software installations, PHP-Nuke is going to be a bit of a disappointment. It's mainly copying files and is not terribly exciting or time-consuming.

Once you've gotten the prerequisites in place, download whatever version of PHP-Nuke you plan to use. I'm using v7.3 for this book; given that a new version comes out every few months you can pretty much rest assured that a newer version will be available as you're reading this. But the installation procedure won't change much.

Start by decompressing the PHP-Nuke package you downloaded. Ideally, you'll decompress this right onto your Web server. You don't have to, though: You can decompress it on your desktop PC or whatever and use a File Transfer Protocol (FTP) client to copy the files up to your Web server, if necessary. Where do the files go? Well, if you want your PHP-Nuke site to be accessible from the root of your Web site (for example, www.mysite.com), put the files in the root (under Apache, it's called the docroot). If you want your files to go in a subdirectory (such as www.mysite.com/phpnuke), create the subdirectory and put the files in it.

Next, you'll need to create a database for PHP-Nuke to use. MySQL comes with a command-line tool called mysqladmin; to create a database, you just run something like mysqladmin create nuke from a command line on your server.

Next, you'll need to build the initial database structure. PHP-Nuke's download package has a subfolder named sql that contains a SQL script; importing that into your newly created database sets up the structure. Running mysql nuke < nuke.sql does the trick. Again, you run that from the command line on your Web server. If you're not using MySQL as your database server, then you're on your own, but other open-source database servers work more or less the same way.

Almost done. Now you need to open the config.php file, which is located right in the root of the PHP-Nuke Web site, in a text file editor. There are a few lines you'll need to edit, since these tell PHP-Nuke where it can find the database, which contains most of the other configuration information. The lines you need to change are right near the top of the file:

 $dbhost = "localhost"; $dbuname = "root"; $dbpass = ""; $dbname = "nuke"; $prefix = "nuke"; $user_prefix = "nuke"; $dbtype = "MySQL"; $sitekey = "SdFk*fa28367-dm56w69.3a2fDS+e9"; $gfx_chk = 0; $subscription_url = ""; 

Under no circumstances should you mess with anything else in the config.php file. Seriously, no good can come of it. Here's what the previous configuration lines are asking for:

  • DBHost The name of the server holding your database. If it's the same machine as your Web server, just leave it at localhost.

  • DBUName The username PHP-Nuke should use to access its database. Enter whatever username you set up. This user must have full read/write access to the entire PHP-Nuke database.

  • DBpass The password for the previously mentioned user. Note that the config.php file can't be easily read by your site's users, but it is possible. I don't recommend using your database server's superuser account in this file; make up a new user that PHP-Nuke will use all for itself.

  • DBName The name of the database PHP-Nuke will use.

  • Prefix The prefix used on each table name in the PHP-Nuke database. Usually, you can leave this as nuke.

  • User_Prefix Again, leaving this as nuke usually works.

  • DBType MySQL is the default, for MySQL databases. This can also be mysql4,postgres,mssql,oracle,msaccess,db2 , or mssql-odbc. Don't think for a second that, just because it's an option, using a Microsoft Access database is a good idea; it isn't. Site performance will be horrible.

  • SiteKey Change this to whatever you want, but don't use any quotation marks within the double quotes that are already there. And don't leave the default value in place! This key will be used to encrypt certain bits of data within your site, so you want the key to be unique to your site.

  • Subscription_URL The URL to which users should be redirected if they try to access a subscribers-only page.

The Gfx_chk parameter is interesting. To prevent automated Web software from creating a zillion user accounts on your Web site, PHP-Nuke implements a graphical check routine. This requires users to type in a series of digits that they read off a graphic. Automated software would have a difficult time "reading" the graphic, especially since it's partially obscured with gridlines, so this simple check helps prevent automated signups and logins. But the little graphic thing can also be a pain for regular users, so you need to decide whether you want to use it. Set the Gfx_chk parameter to meet your preferences:

  • 0 Don't use it.

  • 1 Use it for administrator logins only.

  • 2 Use it for user logins only.

  • 3 Use it for new user signups (registrations) only.

  • 4 Use it for user logins and registrations.

  • 5 Use it for administrator and user logins.

  • 6 Use it for administrators and for new user registrations.

  • 7 Use it for everything.

Okay, next you just need to chmod some files, run a sudo command, download three quantum registers into the oscillating diode array…just kidding. You're finished. You should be able to access your new Web site by using your Web browser.



    PHP-Nuke Garage
    PHP-Nuke Garage
    ISBN: 0131855166
    EAN: 2147483647
    Year: 2006
    Pages: 235
    Authors: Don Jones

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net