Descarregueu  el navegador Mozilla Firefox, per a una visualització web millor i més segura
Descarregueu l'Adobe Reader, per a documents PDF

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

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;

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.

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:)(:include {$Group}.GroupHeader:)(:nl:)

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.

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

In the local/config.php file, set

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

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

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.

Troubleshooting

Why am I seeing strange errors after upgrading?

Make sure all of the files were updated, in particular pmwiki.php.

This question sometimes arises when an administrator hasn't followed the advice, which used to be less prominent, on the installation and initial setup tasks pages and has renamed pmwiki.php instead of creating an index.php wrapper script. If you have renamed pmwiki.php to index.php, then the upgrade procedure won't have updated your index.php file. Delete the old version and create a wrapper script so it won't happen again.

Sometimes an FTP or other copy program will fail to transfer all of the files properly. One way to check for this is by comparing file sizes.

Be sure all of the files in the wikilib.d/ directory were also upgraded. Sometimes it's a good idea to simply delete the wikilib.d/ directory before upgrading. (Local copies of pages are stored in wiki.d/ and not wikilib.d/.)

I'm suddenly getting messages like "Warning: fopen(wiki.d/.flock): failed to open stream: Permission denied..." and Cannot acquire lockfile"... what's wrong?

Something (or someone) has changed the permissions on the wiki.d/.flock file or the wiki.d/ directory such that the webserver is no longer able to write the lockfile. The normal solution is to simply delete the .flock file from the wiki.d/ directory -- PmWiki will then create a new one. Also be sure to check the permissions on the wiki.d/ directory itself.

My links in the sidebar seem to be pointing to non-existent pages, even though I know I created the pages. Where are the pages?

Links in the sidebar normally need to be qualified by a WikiGroup in order to work properly. Otherwise they will point to whatever group you happen to be viewing the sidebar in.

Why am I seeing "Warning: Cannot modify header information - headers already sent ..." messages at the top of my page.

If this is the first or only error message you're seeing, it's usually an indication that there are blank lines or spaces before the <?php or after the ?> in a local customization file. Double-check the file and make sure there aren't any blank lines or spaces before the initial <?php. It's often easiest and safest to eliminate any closing ?> altogether.

If the warning is appearing after some other warning or error message, then resolve the other error and this warning may go away.

Why is PmWiki prompting me multiple times for a password I've already entered?

Usually this is an indication that the browser isn't accepting cookies, or that PHP's session handling functions on the server aren't properly configured. If the browser is accepting cookies, then try setting $EnableDiag=1; in local/config.php, run PmWiki using ?action=phpinfo, and verify that sessions are enabled and that the session.save_path has a reasonable value. Note that several versions of PHP under Windows require that a session_save_path be explicitly set (this can be done in the local/config.php file).

I edited config.php, but when I look at my wiki pages, all I see is "Parse error: parse error, unexpected T_VARIABLE in somefile on line number."

You've made a mistake in writing the PHP that goes into the config.php file. The most common mistake that causes the T_VARIABLE error is forgetting the semi-colon (;) at the end of a line that you added. The line number and file named are where you should look for the mistake.

Searches and pagelists stopped working after I upgraded -- no errors are reported, but links to other pages do not appear (or do not appear as they should) -- what gives?

Be sure all of the files in the wikilib.d/ directory were also upgraded. In particular, it sounds as if the Site.PageListTemplates page is either missing (if no links are displayed) or is an old version (if the links do not appear as they should).

WebFeeds

How can I use the RSS <enclosure> tag for podcasting?

For podcasting of mp3 files, simply attach an mp3 file to the page with the same name as the page (i.e., for a page named Podcast.Episode4, one would attach to that page a file named "Episode4.mp3"). The file is automatically picked up by ?action=rss and used as an enclosure.

The set of potential enclosures is given by the $RSSEnclosureFmt array, thus

$RSSEnclosureFmt = array('{$Name}.mp3', '{$Name}.wma', '{$Name}.ogg');

allows podcasting in mp3, wma, and ogg formats.

How to add "summary" to the title in a rss feed (ie. with ?action=rss)?

Add this line in you local/config.php

$FeedFmt['rss']['item']['title'] = '{$Group} / {$Title} : $LastModifiedSummary';

How do I insert RSS news feeds into PmWiki pages?

See Cookbook:RssFeedDisplay.

DesignNotes

Why doesn't PmWiki use hierarchical / nested groups?

It essentially comes down to figuring out how to handle page links between nested groups; if someone can figure out an obvious, intuitive way for authors to do that, then nested groups become plausible. See DesignNotes and PmWiki:HierarchicalGroups.

Why don't PmWiki's scripts have a closing ?> tag?

All of PmWiki's scripts now omit the closing ?> tag. The tag is not required, and it avoids problems with unnoticed spaces or blank lines at the end of the file. Also, some file transfer protocols may change the newline character(s) in the file, which can also cause problems. See also the Instruction separation page in the PHP manual.

AccessKeys

How can I change the keyboard shortcuts for editing and saving a page?

The default access key values can be changed by site administrators using the string mapping methods to customize a site for other languages by modifying the config.php file. See Internationalizations. Individuals who want to customize the keys used by their browser can use a similar string mapping approach by posting a special query parameter that sets a cookie on their browser. See Site.Preferences.

SkinTemplates

How do I customize the CSS styling of my PmWiki layout?

See Skins for how to change the default PmWiki skin. See also Cookbook:Skins, where you will find pre-made templates you can use to customize the appearance of your site. You can also create a file called local.css in the pub/css/ directory and add CSS selectors there (this file gets automatically loaded if it exists). Or, styles can be added directly into a local customization file by using something like:

$HTMLStylesFmt[] = '.foo { color:blue; }';

Images

How do I insert pictures on wiki pages?

See Images.

Tables

How do I create nice tables similar to Product X?

See tables and table directives.

Spam

I'm getting a lot of spam on my wiki site. How can I password protect the pages?

See Security, UrlApprovals, and the Cookbook:Blocklist2 recipe.

Summary pages

Why are 'RecentChanges' pages editable?

You might want to edit these pages if a spammer creates a page with an unsavory name. To prevent others from editing these pages, insert the following lines into your local/config.php file. Editing then requires the admin password.

## Require admin password to edit RecentChanges (etc.) pages.
if ($action=='edit'
    && preg_match('/\\.(All)?RecentChanges$/', $pagename))
  { $DefaultPasswords['edit'] = '*'; }

How do I generate RSS feeds from PmWiki?

See Web Feeds.

Disable formatting

How do I put plain text into a wiki page and disable wiki formatting?

You can use the [@TEXT GOES HERE@] markup as explained in the section Escape Sequence TextFormattingRules. Note that this preserves any text file formatting such as newlines and spaces.

Read-access to pages in the Site wikigroup

What pages in the Site wikigroup need to be unrestricted for reading by any user of the wiki?

The following pages probably need to be accessible:

Site.EditForm
Site.EditQuickReference
Site.PageActions
Site.PageListTemplates
Site.Search
Site.SideBar
Site.UploadQuickReference
The names of other pages will vary from skin to skin, but you will also want to enable reading of the pages that make up the banner and footer areas of the site.
Page last modified on June 02, 2006, at 08:27 PM
Edit - History - Print - Recent Changes - Search<
Creative Commons License © 2004-2011 Antiblavers.org i altres contribuïdors | visites
Aquesta obra està subjecta a una Llicència de Creative Commons, tret d'on s'indique el contrari.
Funcionant gràcies a PmWiki, PunBB, Coppermine, PHP, MySQL, Apache i GNU/Linux.