This page attempts to answer the more common questions you might have. Many of the answers refer you to other pages for details.

  • To ask a question use the questions? page
  • For frequently requested features, see the PITS pages.

Questions

How do I get my question answered?

The quickest and best way is to join the pmwiki-users mailing list and post your question there. If it really is a frequently-asked question, it will eventually be added to this page.

An alternative way is to leave your question on the Questions page.

Getting help

Where can I get help with PmWiki? (This is a pretty vague question!)

See this FAQ, Troubleshooting, or try a Search.

Error messages

What does warning message or error message "xxxxx" mean?

Error/warning questions and answers are on the Troubleshooting page.

Basic Editing

I'm new to PmWiki, where can I find some basic help for getting started?

This Basic Editing page is a good start. From there, you can just follow the navigational links at the bottom of the page (they are called WikiTrails) to the next pages, or to the Documentation Index page, which provides an outline style index of essential documentation pages, organized from basic to advanced.

How do I include special characters on my wiki pages?

Use character codes to insert special characters, such as Copyright (©) and Trademark (® or ™) symbols, that don't appear on your keyboard.

Links

How do I put a link that will open as a new window?

Use the %newwin% wikistyle, as in:

%newwin%http://www.example.com/

http://www.example.com/

How do I place a mailing address in a page?

Use the mailto: markup, as in one of the following:

    mailto:myaddress@example.com
    [[mailto:myaddress@example.com]]
    [[mailto:myaddress@example.com | email me]]

See also Cookbook:EProtect for information on protecting email addresses from spammers.

How do I make a WikiWord link to an external page instead of a WikiPage?

Use link markup. There are two formats:

    [[http://www.example.com/ | WikiWord]]
    [[WikiWord -> http://www.example.com/]]

How do I find all of the pages that link to another page (i.e., backlinks)?

Use the link= option of the (:pagelist:) directive, as in

    (:pagelist link=SomePage:)   -- show all links to SomePage
    (:pagelist link={$FullName}:)  -- show all links to the current page

Uploads

How do I link to an uploaded file or image from another group?

Use Attach:Groupname./filename.ext . Note the extra dot after the group name.

When I upload a file, how do I make the link look like "file.doc" instead of "Attach:file.doc Δ"?

Use parentheses, as in [[(Attach:)file.doc]]. There is also a configuration change that can eliminate the Attach: -- see Cookbook:AttachLinks.

Why can't I upload files of size more than 50kB to my newly installed PmWiki?

Out of the box PmWiki limits the size of files to be uploaded to 50kB. Add

        $UploadMaxSize = 1000000; # limit upload file size to 1 megabyte

to your config.php to increase the limit to 1MB (for example). See UploadsAdmin for how to further customize limits. Note that both PHP and webservers also place their own limits on the size of uploaded files.

Who does my upload exit unexpectedly with "Incomplete file received"?

You may be running out of space in a 'scratch' area, used either by PmWiki or by PHP. On *nix, check that you have sufficient free space in /tmp and /var/tmp.

Tables

How do I create nice tables similar to Product X?

See tables and table directives.

Table Directives

Can I define table headers using the table directive markup?

No, but you can with Cookbook:AdvancedTableDirectives. See Pm's reply to pending PITS:00535

WikiStyles

Some of my colors aren't working! For example, %color=#AAAAAA% works, but %color=#AA3333% doesn't work. What's wrong?

Be sure to use lowercase letters for rgb hex colors, otherwise PmWiki may mistake the color value for a WikiWord.

PageDirectives

Can I get (:redirect:) to return a "moved permanently" (HTTP 301) status code?

Use (:redirect PageName status=301:).

Is there any way to prevent the "redirected from" message from showing at the top of the target page when I use (:redirect:)?

If you want to suppress the message...

  • in all cases, add add $PageRedirectFmt = ''; in your local/config.php
  • based on the destination/target of the redirect, add $PageRedirectFmt = ''; to a local/group.page.php or local/group.php file (see PmWiki.PerGroupCustomizations).
  • based on the origin/source of the redirect, add the following to your local/config.php
   if (@$_GET['from']) {
     $group = PageVar($_GET['from'], '$Group');
     if ($group == 'SomeGroup') $PageRedirectFmt = '';
   }
Example application: Replace 'SomeGroup' with 'Profiles'

IncludeOtherPages

What's the maximum number of includes that can exist in a page? My site seems to stop including after 48 includes.

By default, PmWiki places a limit of 50 include directives for any given page, to prevent runaway infinite loops and other situations that might eat up server resources. The limit can be modified by the wiki administrator via the $MaxIncludes variable.

Page-specific Variables

Is there a variable like $LastModified, but which shows me the creation time?

No, but you can create one in config.php. For instance:

# add page variable {$PageCreationDate} in format yyyy-mm-dd
$FmtPV['$PageCreationDate'] = 'strftime("%Y-%m-%d", $page["ctime"])';

GroupHeaders

How do I set one header for all pages/groups?

The header for each page is controlled by the $GroupHeaderFmt variable. Thus a site-wide groupheader can be added with

$GroupHeaderFmt = '(:include {$SiteGroup}.SiteHeader:)(:nl:)' . $GroupHeaderFmt;

(note that single quotes must be used so that $Group (which is part of the default contents of $GroupHeaderFmt) will be substituted properly by PmWiki, and that this applies to all variables ending in $...Fmt)

See also the Cookbook:AllGroupHeader page.

Any form of markup is valid in $GroupHeaderFmt, thus one can do

$GroupHeaderFmt .= "Global markup text here.";

PageHistory

Is there a way to remove page history from page files?

1. Administrators can clean page histories using the Cookbook:ExpireDiff recipe.

2. Administrators with FTP file access can download individual pages from the wiki.d directory, open them in a text editor, manually remove history, and re-upload the files to wiki.d/ directory. Care must be exercised, when manually editing a page file, to preserve the minimum required elements of the page and avoid corrupting its contents. See PageFileFormat#creating.

3. Edit the page. Select all the contents of the edit text area and cut them to the clipboard. Enter delete into the text area and click on the save and edit button. Select all the contents of the edit text area and paste the contents of the clipboard over them. Click on the save button. This will remove all of the page's history up to the final save in which the pasted material is re-added.

How can I restrict viewing the page history to people with edit permission?

In the local/config.php file, set

$HandleAuth['diff'] = 'edit';

Passwords

How can I password protect all the pages and groups on my site? Do I really have to set passwords page by page, or group by group?

Administrators can set passwords for the entire site by editing the config.php file; they don't have to set passwords for each page or group. For example, to set the entire site to be editable only by those who know an "edit" password, an administrator can add a line like the following to local/config.php:

    $DefaultPasswords['edit'] = crypt('edit_password');

For more information about the password options that are available only to administrators, see PasswordsAdmin.

How can I create private groups for users, so that each user can edit pages in their group, but no one else (other than the admin) can?

Administrators can use the AuthUser recipe and add the following few lines to their local/config.php file to set this up:

    $group = FmtPageName('$Group', $pagename); 
$DefaultPasswords['edit'] = 'id:'.$group;
include_once("$FarmD/scripts/authuser.php");

This automatically gives edit rights to a group to every user who has the same user name as the group name.

PageLists

How can I configure my site to always exclude wiki-related pages from searches?

Try the following in your local/config.php file. See also Cookbook:SearchPatterns.

## Exclude Certain pages / groups from search results.
$SearchPatterns['default'][] = '!\\.(All)?Recent(Changes|Uploads|Comments)$!';
$SearchPatterns['default'][] = '!\\.Group(Print)?(Header|Footer|Attributes)$!';
$SearchPatterns['default'][] = '!\\.(Left|Right|Side)(Bar|Menu|Note)$!';
$SearchPatterns['default'][] = '!^Site\\.!';
$SearchPatterns['default'][] = '!^PmWiki\\.!';

If you add $SearchPatterns['default']... to exclude groups and pages from pagelist and search output, you can include the omitted pages by using "list=all" in the pagelist or search parameters.

PmWiki Installation

How do I make pmwiki.php the default page for a website? Should I rename pmwiki.php to index.php?

Renaming pmwiki.php is not recommended. Instead, create an index.php file that contains the single line:

<?php include_once('pmwiki.php');

You may also want to check Cookbook:CleanUrls.

Why does pmwiki.org appear to have a directory structure rather than "?n=pagename" in urls?

Pmwiki.org uses a variant of Cookbook:CleanUrls.

Is it possible to move wiki.d to /tmp/persistent/wiki.d (a new sourceforge rule)?

Sourceforge suggests moving everything to /tmp/persistent/new-folder-of-your-choice and creating a symbolic link to the new folder on /tmp . It works -- see Cookbook:SourceForgeServers.

How can I run PmWiki on a standalone (offline, portable) machine ?

See Cookbook:Standalone.

LocalCustomizations

How do I get the group / page name in a local configuration file (e.g. local/config.php)?

Use the following markup in pmwiki-2.1.beta21 or newer:

## Get the group and page name
$pagename = ResolvePageName($pagename);
$group = PageVar($pagename, '$Group');
$name = PageVar($pagename, '$Name');

Can I remove items from the wikilib.d folder on my site?

Yes, the files in wikilib.d/ can be safely removed. They'll reappear again when you upgrade, however. If you want to permanently configure your site so that these distribution pages don't appear, try:

$WikiLibDirs = array(&$WikiDir);

How do I customize my own 404 error page for non-existent pages?

To change the text of the message, try editing the Site.PageNotFound page.

Skins

How do I change the Wiki's default name in the upper left corner of the Main Page?

Put the following config.php

$WikiTitle = 'My Wiki Site';

The docs/sample-config.php file has an example of changing the title.

How can I embed PmWiki pages inside a web page?

Source them through a PHP page, or place them in a frame.

How do I change the font or background color of the hints block on the Edit Page?

Add a CSS style to pub/css/local.css: .quickref {background:...; color:... }. The hints are provided by the Site.EditQuickReference page, which is in the PmWiki or Site wikigroup. Edit that page, and change the "bgcolor" or specify the font "color" to get the contrast you need.

PasswordsAdmin

There seems to be a default password. What is it?

There isn't any valid password until you set one. PasswordsAdmin describes how to set one.

PmWiki comes "out of the box" with $DefaultPasswords['admin'] set to '*'. This doesn't mean the password is an asterisk, it means that default admin password has to be something that encrypts to an asterisk. Since it's impossible for the crypt() function to ever return a 1-character encrypted value, the admin password is effectively locked until the admin sets one in config.php.

How do I use passwd-formatted files (like .htpasswd) for authentication?

See AuthUser or Cookbook:UserAuth

Is there anything I can enter in a GroupAttributes field to say 'same as the admin password'? If not, is there anything I can put into the config.php file to have the same effect?

For the sitewide edit password (in config.php), use '@_site_edit'. I haven't tested this, but I think one can also use '@_site_admin', '@_site_read', '@_site_attr', etc. for the other site-wide passwords set in config.php. '@admin' is used to specify the site admin password.

How do I edit protect, say, all RecentChanges pages?

(needs answer)

AuthUser

Can I specify authorization group memberships from with local/config.php?

You can as of version 2.1.14 -- simply put the group definition into the $AuthUser array:

        $AuthUser['@editors'] = array('alice', 'carol', 'bob');

Uploads Administration

How do I disable uploading of a certain type of file?

Here's an example of what to add to your local/config.php file to disable uploading of .zip files:

$UploadExtSize['zip'] = 0; # Disallow uploading .zip files.

How do I attach uploads to individual pages or the entire site, instead of organizing them by wiki group?

Use the $UploadPrefixFmt variable (see also the Cookbook:UploadGroups recipe).

$UploadPrefixFmt = '/$FullName'; # per-page
$UploadPrefixFmt = ''; # site-wide

For $UploadDirQuota - can you provide some units and numbers? Is the specification in bytes or bits? What is the number for 100K? 1 Meg? 1 Gig? 1 Terabyte? jb?

Units are in bytes.

100K: $UploadDirQuota =        100000;
 1MB: $UploadDirQuota =       1000000;
 1GB: $UploadDirQuota =    1000000000;
 1TB: $UploadDirQuota = 1000000000000;
pm?

Internationalizations

If my wiki is internationalized by config.php, how do I revert a specific group to English?

Use $XLLangs = array('en'); in the group.php configuration file.

CustomMarkup

How can I embed JavaScript into a page's output?

There are several ways to do this. The Cookbook:JavaScript recipe describes a simple means for embedding static JavaScript into web pages using custom markup. For editing JavaScript directly in wiki pages (which can pose various security risks), see the JavaScript-Editable recipe. For JavaScript that is to appear in headers or footers of pages, the skin template can be modified directly, or