InstallFaq

From GeeklogWiki
Revision as of 05:01, 23 November 2004 by N4th4n (talk | contribs) (=Will Geeklog work with register_globals off?=)

Jump to: navigation, search

Configuring Email (Geeklog 1.3.9 and newer versions)

Starting with version 1.3.9, Geeklog uses the PEAR::Mail class to send all emails, offering you the following methods to send emails:

  • 'smtp', i.e. using an SMTP server
  • 'mail', i.e. using PHP's built-in mail function
  • 'sendmail', i.e. using the Unix sendmail application

All the following settings can be found in your config.php.

SMTP

To configure Geeklog to send all emails using an SMTP server, set 'backend' to 'smtp' and enter the information to contact your SMTP server as follows:

'host' => 'name of your smtp server',
'port' => '25',
'auth' => false,
'username' => 'your smtp username',
'password' => 'your smtp password'

You should have gotten these settings from your ISP. The name of the smtp server is usually something like 'smtp.your-domain.com' but in some cases it's simply 'localhost'. The port number is usually 25. The 'auth' option tells Geeklog whether to use authentication or not (set to true for authentication).

mail

When setting 'backend' to 'mail' (which is also the default) Geeklog will use PHP's built-in mail() function. None of the other $_CONF['mail_settings'] options have to be changed for this.

This is almost like what Geeklog used in versions prior to 1.3.9. There is, however, a difference in how PEAR::Mail implements this option so that 'mail' can not be used when safe_mode is activate on your webserver. You will have to use one of the other options if that is the case for you.

sendmail

On most setups, there isn't any benefit in using this option - it's mainly provided for completeness. You can set the path to the sendmail binary ('sendmail_path') and pass additional arguments to sendmail by setting 'sendmail_args' accordingly.

Which method should I use?

If you can, SMTP is probably the best method to use. It ensures that the email is sent through your SMTP server which reduces the chances that emails are regarded as spam by some of the more strict mail filters.

'mail' is the second-best option but, as noted above, won't work when safe_mode is on.

A fourth option

If none of the above methods work for you, there is a fourth option: You can implement your own function to send email. This may be necessary on some free hosting services that disable PHP's mail function.

The function must be called CUSTOM_mail. A sample implementation is included in the lib-custom.php file that ships with Geeklog. This sample code is a re-implementation of the way Geeklog sent emails prior to 1.3.9. It also uses PHP's mail function, but in such a way that it will work when safe_mode is on.

Please note that the function is commented out by default - you will have to remove the comments around the function before it will be used.

Geeklog on PHP 5

Here are some initial observations, a few days after the official release of PHP 5.0.0:

  • The links to plugins don't show up properly in the Admin and User Functions blocks, as well as in the "Command and Control" block. The problem is in lib-plugins.php and a fix (for Geeklog 1.3.9sr1) is available from CVS.
  • Make sure you have register_long_arrays = On in your php.ini. For compatibility with old versions of PHP 4, Geeklog relies on the "old-style" input arrays, $HTTP_POST_VARS and $HTTP_GET_VARS.
  • Don't forget to switch register_globals = On


How can I upgrade from a version of Geeklog older than 1.2.5-1?

If you are running a version of Geeklog older than 1.2.5-1 you will need to upgrade your database from your current version to 1.2.5-1 using the SQL scripts in the sql/updates directory. Once you have the database upgraded to 1.2.5-1 you can run the installation script to upgrade to the current version.


How do I find out my paths?

Just call up the install script http://yourgeeklogsite/admin/install/install.php. At the bottom of the page, it will give you a hint what the complete path to the install script is and, depending on your configuration, it may also tell you what you need to set as your "path to geeklog". You should be able to figure the paths out from these hints.

If you have shell access to your webserver, another way to find out the proper paths is to change to the directories in question (e.g. the one where the config.php resides) and enter the Unix pwd command, which will print out the current path.

How do I setup PHP mail for Windows?

Geeklog prior to version 1.3.9 uses the built-in mail function in PHP. In your php.ini file find the following section header: [mail function]

Setup the smtp directive to either you local server or your ISP. Also setup the sendmail_from directive. That should do it.

[mail function]

For Win32 only.

SMTP = mail.mw.centurytel.net

For Win32 only.

sendmail_from = admim@somegeeklogsite.com

For Unix only. You may supply arguments as well (default
"sendmail -t -i").
sendmail_path =

Starting with Geeklog 1.3.9, you can make those settings in Geeklog's config.php instead. See this FAQ for details.


Migrating a Geeklog Site

Sooner or later, you'll be facing the problem of having to move your Geeklog site from one server to another, e.g. when changing hosting services. Here are a few tips to successfully make that transition:

  1. Create a backup of your Geeklog database on your old server
  2. Make backups of the story images in the images/articles and the userphotos in the images/userphoto directories
  3. Make a backup of your config.php for reference
  4. Make a backup of your theme

We'd suggest that you start with a fresh install on your new site. Moving your site is also the perfect opportunity to upgrade if you haven't been running the latest version of Geeklog anyway (use the "GL Version Test" link on your old site to check if you are running the current version).

Once you have Geeklog up and running on the new server, you can drop the database, create an empty database again, and then import the database backup from your old site (see Restoring a database backup).


  • If you had any plugins installed (besides the Static Pages plugin), you should now upload their files on the new server as well (don't run any install scripts for those plugins, though).
  • Upload your story images and userphotos into their new locations.
  • If you're upgrading to a new Geeklog version in the process, then don't upload your theme just yet. New Geeklog versions usually include changes in the theme files and you should use one of the included default themes until you can be sure your migrated site works properly.
  • If you're upgrading your Geeklog site, run the install script in upgrade mode now.
  • If you've updated any of your plugins, run their upgrade scripts now, if necessary (please refer to the documentation of your plugins to see if that is necessary).
  • Make sure everything works properly. See if you can edit stories, for example.
  • Update your theme, if necessary. Refer to Geeklog's theme documentation for a list of changes in the themes.

That's it. You've successfully migrated your Geeklog site.


Common problems

  • Make sure register_globals=on on your new server.
You can check this by creating a file (in a text editor) with the following lines:
<?php
phpinfo(); ?>
save this file somewhere on your server as "phpinfo.php" and load it in up in your browser. This will generate a nice table with all the current settings of your php installation. If register_globals is OFF, see the tip below.
  • If the URL of your site changed, then the URLs to any uploaded images in your stories will still point to your old site. There is, unfortunately, no easy solution for this yet, so you'll have to edit those image URLs in the database directly (using phpMyAdmin). This is currently listed as a bug and will be addressed in a future version of Geeklog.

What are the System Requirments for Geeklog?

Geeklog requires PHP, MySQL and a webserver that works with these.

PHP: The minimum PHP version required is PHP 4.0.4. However, that version is very much out of date (and has security issues), so we suggest you use PHP 4.1.2 at the very least. Or, better yet, use the most up to date version available at the time you're reading this.

At the time of this writing, PHP 5 is still in Beta. As one of the main goals of PHP 5 development was to keep compatibility with PHP 4, we do not expect any serious problems with PHP 5. We plan to be fully compatible with PHP 5 when it is released.

MySQL: While we try to be compatible with MySQL down to version 3.22, we recommend using the most up to date version of the 3.23 or 4.0 variety available at the time you're reading this.

Please note that because of possible SQL injection problems, we do not recommend using Geeklog on MySQL 4.1 (which is still in Alpha state at the time of this writing). We plan to resolve any outstanding issues with the release of Geeklog 1.3.9 in early 2004.

Webserver: Geeklog is known to work with the Apache, Zeus, and Microsoft IIS webservers. As with the other components, it is suggested to use the most up to date version available at the time you're reading this.

A note about Apache 2 compatibility: At the time of this writing, there was still no official word from the PHP developers regarding compatibility of PHP 4 and Apache 2. There are, however, several sites running without any problems on this combination. Again, it is suggested to use the most up to date version of both Apache and PHP.


Where Do I enter the mail server configuration?

For Geeklog 1.3.9 and newer versions, please see this FAQ entry.

Older Geeklog versions simply use PHP's mail() function to send all email. To make that function work, you will need to edit your php.ini file.

The PHP manual has all the information you need.

In case your site is running on Windows, this FAQ entry has additional information.


Will you install Geeklog for me?

Sure. The people listed in this story will be more than willing to install it for you.

Will Geeklog work with register_globals off?

No.

How to tell if it's on of off

If you can't set register_globals=on in php.ini (e.g. because you don't have access to it) you can try to create a .htaccess file in your document root that has this line in it:

php_flag register_globals on

This will only work when your webserver is Apache (does a similar option exist for IIS?) and when it's configured such that it lets you override the register_globals setting.

See also: Isn't it a security risk to have register_globals=on?