This page will attempt to summarize some of the more commonly asked questions. The answers are on the corresponding pages (see link). If you have a question which isn't answered here, you can leave your question on the Questions page or search for documentation using the search facility. More documentation can be found on the documentation index page.
Introduction
What is PmWiki?
PmWiki is a wiki-based system for collaborative creation and maintenance of websites. See PmWiki.
What can I do with it?
PmWiki pages look and act like normal web pages, except they have an "Edit" link that makes it easy to modify existing pages and add new pages into the website, using basic editing rules. You do not need to know or use any HTML or CSS. Page editing can be left open to the public or restricted to small groups of authors. Feel free to experiment with the Text Formatting Rules in the "Wiki sandbox". The website you're currently viewing is built and maintained with PmWiki.
What are the requirements?
See the PmWiki requirements page.
Where can I find documentation?
See the documentation index page.
How can I download PmWiki?
See the download page.
How do I install PmWiki?
Instructions for installation are on the installation page.
How do I get help with PmWiki?
See Mailing lists and How to get assistance.
Basic PmWiki editing rules
I'm new to PmWiki, where can I find some basic help for getting started?
The Basic Editing page is a good start. From there, you can just follow the navigational links at the top or the bottom of the page (they are called Wiki Trails) 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 such as Copyright (©) and Trademark (® or ™) on my wiki pages?
See special characters on how to insert special characters that don't appear on your keyboard.
Why are separate lines of text in the markup combined into a single line on output?
PmWiki normally treats consecutive lines of text as being a paragraph, and merges and wraps lines together on output. This is consistent with most other wiki packages. An author can use the (:linebreaks:)
directive to cause separate lines of markup text to be kept as separate lines in the output. Or a wiki administrator can set in config.php $HTMLPNewline = '<br/>';
to force literal new lines for the whole site.
Can I just enter HTML directly?
By default (and by design), PmWiki does not support the use of HTML elements in the editable markup for wiki pages. There are a number of reasons for this described in the PmWiki Philosophy and Audiences. Enabling HTML markup within wiki pages in a collaborative environment may exclude some potential authors from being able to edit pages, and pose a number of display and security issues. However, a site administrator can use the Cookbook:Enable HTML recipe to enable the use of HTML markup directly in pages.
Where can I find more documentation?
See the documentation index and the markup master index pages.
Creating New Pages
How do I create a new page?
Typing [[my new page]] will create a link to the new page. There's a lot you can do with double bracket links.
Why do some new pages have a title with spaces like "Creating New Pages" and others end up with a WikiWord-like title like "CreatingNewPages"?
The default page title is simply the name of page, which is normally stored as "CreatingNewPages." However, you can override a page's title by using the (:title Creating New Pages:)
directive. This is especially useful when there are special characters or capitalization that you want in the title that cannot be used in the page name.
Links
How do I create a link that will open as a new window?
Use the %newwin%
wikistyle, as in:
%newwin% http://example.com/ %% |
How do I create a link that will open a new window, and configure that new window?
This requires javascript. See Cookbook:PopupWindow.
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]] * [[mailto:myaddress@example.com?subject=Some subject | email me]] |
The markup [[mailto:me@example.com?cc=someoneelse@example.com&bcc=else@example.com&subject=Pre-set Subject&body=Pre-set body | display text]] =]
lets you specify more parameters like the message body and more recipients (may not work in all browsers and e-mail clients).
See also Cookbook:DeObMail for information on protecting email addresses from spammers.
How can I enable links to other protocols, such as nntp:, ssh:, xmpp:, etc?
How do I make a WikiWord link to an external page instead of a WikiPage?
Use link markup. There are two formats:
[[http://example.com/ | WikiWord]] [[WikiWord -> http://example.com/]]
How do I find all of the pages that link to another page (i.e., backlinks)?
In the wiki search form, use link=Group.Page
to find all pages linking to Group.Page.
Use the link=
option of the (:pagelist:)
directive, as in
(:pagelist link=SomePage list=all:) -- show all links to SomePage (:pagelist link={$FullName} list=all:) -- show all links to the current page
What link schemes does PmWiki support?
How do I open external links in a new window or mark them with an icon?
How can I use an image as a link?
Use [[Page| Attach:image.jpg ]] or [[ http://site | http://site/image.jpg ]] See Images#links
Uploads
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
Why 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.
How do I make it so that the upload link still allows one to make another upload (if someone wants to replace the old version of a file with a newer version, for example). Currently you only get the upload link when there is no file in the upload directory.
Use the Attach page action, and click on the delta symbol (Δ) shown against each of files listed. If you can't see the attach action either uploads are not enabled, you are not not authorized to upload, or the attach action has been commented out or is missing. See also available actions.
How do I hide the "Attach:" for all attachments
See Cookbook:AttachLinks, note that this does not currently work for [[Attach:my file.ext]]
.
How to avoid problems with non-ASCII characters in attachment names (i.e. "Zażółć geślą jaźń.doc")?
See $UploadNameChars
= "-\w. !=+#";
# allow exclamations, equals, plus, and hash
How can I link a file that have a 4-letter file extension such like 'abc.pptx'?
How can I prevent others from using the url's of my images on their site
Tables
How do I create a basic table?
Tables are created via use of the double pipe character: ||
. Lines beginning with this markup denote rows in a table; within such lines the double-pipe is used to delimit cells. In the examples below a border is added for illustration (the default is no border).
|| border=1 rules=rows frame=hsides || cell 1 || cell 2 || cell 3 || || cell 1 || cell 2 || cell 3 || |
|
How do I create cell headers?
Header cells can be created by placing ! as the first character of a cell. Note that these are table headers, not headings, so it doesn't extend to !!, !!!, etc.
|| border=1 rules=cols frame=vsides ||! cell 1 ||! cell 2 ||! cell 3 || || cell 1 || cell 2 || cell 3 || |
|
How do I obtain a table with thin lines and more distance to the content?
"Thin lines" is tricky and browser dependent, but the following works for Firefox and IE (Nov. 2009):
||border="1" bordercolordark="black" bordercolorlight="black" style="border-collapse:collapse" cellpadding="5" width=66% ||!Header || !Header|| '''Header'''|| ||cells || with || padding|| || || || || |
|
How do I create an advanced table?
See table directives
My tables are by default centered. When I try to use '||align=left' they don't align left as expected.
Use ||style="margin-left:0px;" instead.
How can I specify the width of columns?
You can define the widths via custom styles, see Cookbook:FormattingTables and $TableCellAttrFmt
. Add in config.php :
$TableCellAttrFmt = 'class=col\$TableCellCount';
table.column td.col1 { width: 120px; } table.column td.col3 { width: 40px; }
How can I display a double pipe "||" in cell text using basic table markup?
Escape it with [=||=]
to display || unchanged.
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
Is it possible to do nested tables?
Yes, if you nest simple tables inside advanced tables. See also Cookbook:AdvancedTableDirectives.
Is it possible to add background images to tables and table cells?
Yes, see Cookbook:BackgroundImages.
WikiStyles
AccessKeys
How can I change the keyboard shortcuts for editing and saving a page?
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:)
?
From version 2.2.1 on, set in config.php
and in the page $EnableRedirectQuiet
=1;(:redirect OtherPage quiet=1:)
for a quiet redirect.
Is there any method for redirecting to the equivalent page in a different group, i.e. from BadGroup/thispage => GoodGroup/thispage using similar markup to (:redirect Goodgroup.{Name}:)?
IncludeOtherPages
What's the maximum number of includes that can exist in a page?
How do I get started writing recipes and creating my own custom markup?
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's group customization file.
If my wiki is in English and I want just one page, or group, in Spanish do I say XLPage('es','PmWikiEs.XLPage');
in the group or page configuration file?
Yes, that is usually the best method. If you were doing this with many scattered pages, or with several languages, you might find it easier to maintain if you load the translations all in config.php like this:
XLPage('es','PmWikiEs.XLPage');
XLPage('fr','PmWikiFr.XLPage');
XLPage('ru','PmWikiRu.XLPage');
$XLLangs
= array('en');
Then in each group or page configuration file, you'd just use $XLLangs
= array('es'); to set the language to use (in this case, Spanish). Note that though this method is easier to maintain, its somewhat slower because it loads all the dictionaries for each page view, even if they won't be used.
What does the first parameter of this function stand for? How can it be used?
The XLPage mechanism allows multiple sets of translations to be loaded, and the first parameter is used to distinguish them.
For example, suppose I want to have translations for both normal French and "Canadian" French. Rather than maintain two entirely separate sets of pages, I could do:
XLPage('fr', 'PmWikiFr.XLPage'); XLPage('fr-ca', 'PmWikiFrCa.XLPage');
PmWikiFr.XLPage would contain all of the standard French translations, while PmWikiFrCA.XLPage would only need to contain "Canada-specific" translations -- i.e., those that are different from the ones in the French page.
The first parameter distinguishes the two sets of translations.
In addition, a config.php script can use the $XLLangs
variable
to adjust the order of translation, so if there was a group or
page where I only wanted the standard French translation, I
can set
$XLLangs
= array('fr', 'en');
and PmWiki will use only the 'fr' and 'en' translations (in that order), no matter how many translations have been loaded with XLPage().
Tools for PmWiki Localization
You can help to localize PmWiki in your language in the original site:
LocalCustomizations
There's no "config.php"; it's not even clear what a "local customisation file" is!
The "sample-config.php" file in the "docs" folder, is given as an example. Copy it to the "local" folder and rename it to "config.php". You can then remove the "#" symbols or add other commands shown in the documentation. See also Group Customizations.
Can I change the default page something other than Main.HomePage ($DefaultPage
)?
Yes, just set the $DefaultPage
variable to the name of the page you want to be the default. You might also look at the $DefaultGroup
and $DefaultName
configuration variables.
$DefaultPage = 'ABC.StartPage';
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); $page = PageVar($pagename, '$FullName'); $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.
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.
Is the order of customizations in config.php important? Are there certain things that should come before or after others in that file?
Yes, the following has been recommended on the mailing list:
- define
$ScriptUrl
and$PubDirUrl
, if needed, - define any custom PageStore class, like SQLite, CompressedPageStore or PerGroupSubDirectories,
- next include_once scripts/xlpage-utf-8.php,
- next call XLPage() which needs the definitive (rw)
$WikiDir
already set in order to find the wiki page containing the translations, - next include authuser.php (if needed), because PmWiki caches some group and page authorization levels when a page is accessed,
- next include any other scripts and recipes,
- any direct function call in config.php, like ResolvePageName(), CondAuth(), PageTextVar(), PageVar(), RetrieveAuthPage(), or others, if possible, should be done near the end of config.php.
Note, each part is not required, but if your wiki needs it, this is the recommended order in config.php.
GroupCustomizations
How can I apply CSS styles to a particular group or page?
Simply create a pub/css/Group.css or pub/css/Group.Page.css file containing the custom CSS styles for that group or page.
Why shouldn't passwords be set in group (or page) customization files?
The reason for this advice is that per-group customization files are only loaded for the current page. So, if $DefaultPasswords['read']
is set in local/GroupA.php, then someone could use a page in another group to view the contents of pages in GroupA. For example, Main.WikiSandbox could contain:
- (:include GroupA.SomePage:)
and because the GroupA.php file wasn't loaded (we're looking at Main.WikiSandbox --> local/Main.php), there's no read password set.
The same is true for page customization files.
Isn't that processing order strange? Why not load per page configuration last (that is after global configuration an per group configuration)?
Many times what we want to do is to enable a certain capability for a group of pages, but disable it on a specific page, as if it was never enabled. If the per-group config file is processed first, then it becomes very difficult/tedious for the per-page one to "undo" the effects of the per-group page. So, we load the per-page file before the per-group.
If a per-page customization wants the per-group customizations to be performed first, it can use the techniques given in PmWiki.GroupCustomizations (using include_once() or setting $EnablePGCust = 0
).
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.
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; }';
Where can the mentioned "translation table" be found for adding translated phrases?
Is it possible to have the edit form in full page width, with no sidebar?
If the sidebar is marked with <!--PageLeftFmt-->
, adding (:noleft:)
to Site.EditForm will hide it when a page is edited.
Can I easily hide the Home Page title from the homepage?
Yes, you can use in the wiki page either (:title Some other title:)
to change it or (:notitle:)
to hide it.
Is it possible to hide the Search-Bar in the default PmWiki Skin?
Yes, please see Cookbook:HideSearchBar.
WebFeeds
How do I include text from the page (whole page, or first X characters) in the feed body? (note: markup NOT digested)
function MarkupExcerpt($pagename) {
$page = RetrieveAuthPage($pagename, 'read', false);
return substr(@$page['text'], 0, 200);
}
$FmtPV
['$MarkupExcerpt'] = 'MarkupExcerpt($pn)';
$FeedFmt['rss']['item']['description'] = '$MarkupExcerpt';
Q:Does this mean if I want to include the time in the rss title and "summary" to rss body I call $FeedFmt
twice like so:
$FeedFmt['rss']['item']['description'] = '$LastSummary'; $FeedFmt['rss']['item']['title'] = '{$Group} / {$Title} @ $ItemISOTime';
- From mailing list Feb 13,2007, a response by Pm: Yes
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 to add "description" to the title in an rss feed, and summary to the body?
Add these lines to your local/config.php
$FeedFmt['rss']['item']['title'] = '{$Group} / {$Title} : {$Description}';
$FeedFmt['rss']['item']['description'] = '$LastModifiedSummary';
NOTES:
- you need to replicate these lines for each type (atom, rdf, dc) of feed you provide.
- the RSS
description
-tag is not equivalent to the pmWiki$Description
variable, despite the confusing similarity.
Some of my password-protected pages aren't appearing in the feed... how do I work around this?
From a similar question on the newsgroup, Pm's reply:
The last time I checked, RSS and other syndication protocols didn't really have a well-established interface or mechanism for performing access control (i.e., authentication). As far as I know this is still the case.
PmWiki's WebFeeds capability is built on top of pagelists, so it
could simply be that the $EnablePageListProtect
option is preventing
the updated pages from appearing in the feed. You might try
setting $EnablePageListProtect
=0; and see if the password-protected
pages start appearing in the RSS feed.
The "downside" to setting $EnablePageListProtect
to zero is that
anyone doing a search on your site will see the existence of the
pages in the locked section. They won't be able to read any of
them, but they'll know they are there!
You could also set $EnablePageListProtect
to zero only if ?action=rss:
if ($action == 'rss') $EnablePageListProtect
= 0;
This limits the ability to see the protected pages to RSS feeds; normal pagelists and searches wouldn't see them.
Lastly, it's also possible to configure the webfeeds to obtain the authentication information from the url directly, as in:
.../Site/AllRecentChanges?action=rss&authpw=secret
The big downside to this is that the cleartext password will end up traveling across the net with every RSS request, and may end up being recorded in Apache's access logs.
How to add feed image?
Add the following to local/config.php (this example is for ?action=rss
):
$FeedFmt['rss']['feed']['image'] = " <title>Logo title</title> <link>http://example.com/</link> <url>http://example.com/images/logo.gif</url> <width>120</width> <height>60</height>";
How do I insert RSS news feeds into PmWiki pages?
How can I specify default feed options in a configuration file instead of always placing them in the url?
For example, if you want ?action=rss
to default to ?action=rss&group=News&order=-time&count=10
, try the following in a local customization file:
if ($action == 'rss') SDVA($_REQUEST, array( 'group' => 'News', 'order' => '-time', 'count' => 10));
Are there ways to let people easily subscribe to a feed?
On some browsers (Mozilla Firefox), the visitor can see an orange RSS icon in the address bar, and subscribe to the feed by clicking on it. To enable the RSS icon, add this to config.php :$HTMLHeaderFmt['feedlinks'] = '<link rel="alternate" type="application/rss+xml" title="$WikiTitle" href="$ScriptUrl?n=Site.AllRecentChanges&action=rss" /> <link rel="alternate" type="application/atom+xml" title="$WikiTitle" href="$ScriptUrl?n=Site.AllRecentChanges&action=atom" />';
You can also add such a link, for example in your SideBar, [[Site.AllRecentChanges?action=atom | Subscribe to feed]]
.
Can I create an RSS feed for individual page histories?
See Cookbook:PageFeed.
How do I create a custom FeedPage similar to RecentChanges or AllRecentChanges, but with only certain groups or pages recorded?
See Cookbook:CustomRecentChanges. In a nutshell, you'll declare a $RecentChangesFmt
variable with your dedicated FeedPage, and then wrap it in a condition of your choice. For example:
if (PageVar($pagename, '$Group')!='ForbiddenGroup') { $RecentChangesFmt['Site.MyFeedPage'] = '* [[{$FullName}]] . . . $CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]'; }
FAQ
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. (One can easily check and modify permissions of the wiki.d/ directory in FileZilla (open-source FTP app) by right-clicking on the file > File attributes)
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 (use [[Group.Page]] instead of [[Page]]).
Also: Make sure you type SideBar with a capital B.
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. On Windows, it may be necessary to use a hex editor to convert LFCR line endings to LF line endings in the local\config.php file.
If the warning is appearing after some other warning or error message, then resolve the other error and this warning may go away.
How do I make a PHP Warning about function.session-write-close
go away?
If you are seeing an error similar to this
Warning: session_write_close() [function.session-write-close]: open(/some/filesystem/path/to/a/directory/sess_[...]) failed: No such file or directory (2) in /your/filesystem/path/to/pmwiki.php on line NNN
PmWiki sometimes does session-tracking using PHP's session-handling functions. For session-tracking to work, some information needs to be written in a directory on the server. That directory needs to exist and be writable by the webserver software. For this example, the webserver software is configured to write sessions in this directory
/some/filesystem/path/to/a/directory/
but the directory doesn't exist. The solution is to do at least one of these:
- Create the directory and make sure it's writable by the webserver software
- Provide a session_save_path value that points to a directory that is writable by the server, e.g.
session_save_path('/home/someuser/tmp/sessions');
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). You might also try setting session.auto_start to 1 in your php.ini.
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). Allso make sure that read-permissions (attr) are set for the pages Site.PageListTemplates and Site.Search.
Some of my posts are coming back with "403 Forbidden" errors, "Not Acceptable", or "Internal Server Error". This happens with some posts but not others.
Your webserver probably has mod_security enabled. The mod_security "feature" scans all incoming posts for forbidden words or phrases that might indicate someone is trying to hack the system, and if any of them are present then Apache returns the 403 Forbidden error. Common phrases that tend to trigger mod_security include "curl ", "wget", "file(", and "system(", although there are many others.
Since mod_security intercepts the requests and sends the "forbidden"
message before PmWiki ever gets a chance to run, it's not a bug in PmWiki, and
there's little that PmWiki can do about it. Instead, one has to alter the
webserver configuration to disable mod_security or reconfigure it to allow
whatever word it is forbidding. Some sites may be able to disable mod_security
by placing SecFilterEngine off
in a .htaccess file.
I get the following message when attempting to upload an image, what do I do?
Warning: move_uploaded_file(): SAFE MODE Restriction in effect. The script whose uid is 1929 is not allowed to access /home/onscolre/public_html/pmwikiuploads/Photos owned by uid 33 in /home/onscolre/public_html/pmwiki/scripts/upload.php on line 198
PmWiki can't process your request
?cannot move uploaded file to /home/onscolre/public_html/pmwikiuploads/Photos/FoundationPupilsIn1958.jpeg
We are sorry for any inconvenience.
Your server is configured with PHP Safe Mode enabled. Configure your wiki to use a site-wide uploads prefix, then create the uploads/ directory manually and set 777 permissions on it (rather than letting PmWiki create the directory).
I'm starting to see "Division by zero error in pmwiki.php..." on my site. What's wrong?
It's a bug in PmWiki that occurs only with the tables markup and only for versions of PHP >= 4.4.6 or >= 5.2.0. Often it seems to occur "out of nowhere" because the server administrator has upgraded PHP. Try upgrading to a later version of PmWiki to remove the error, or try setting the following in local/config.php:
$TableRowIndexMax
= 1;
I have to log in twice (two times) (2 times). -or- My password is not being required even though it should. -or- I changed the password but the old password is still active. -or- My config.php password is not over-riding my farmconfig.php password.
It could happen if (farm)config.php, or an included recipe, directly calls the functions CondAuth(), or RetrieveAuthPage(), PageTextVar(), PageVar() and possibly others, before defining all passwords and before including AuthUser (if required).
The order of config.php is very significant.
AuthUser
I get http error 500 "Internal Server Error" when I try to log in. What's wrong?
This can happen if the encrypted passwords are not created on the web server that hosts the PmWiki. The crypt function changed during the PHP development, e.g. a password encrypted with PHP 5.2 can not be decrypted in PHP 5.1, but PHP 5.2 can decrypt passwords created by PHP 5.1. This situation normally happens if you prepare everything on your local machine with the latest PHP version and you upload the passwords to a webserver which is running an older version. The same error occurs when you add encrypted passwords to local/config.php.
Solution: Create the passwords on the system with the oldest PHP version and use them on all other systems.
Can I specify authorization group memberships from with local/config.php?
Yes -- put the group definition into the $AuthUser array (in config.php):
$AuthUser['@editors'] = array('alice', 'carol', 'bob');
I'm running multiple wikis under the same domain name, and logins from one wiki are appearing on other wikis. Shouldn't they be independent?
This is caused by the way that PHP treats sessions. See PmWiki.AuthUser#sessions for more details.
Is there any way to record the time of the last login for each user when using AuthUser? I need a way to look for stale accounts.
Though every settings seem correct, authentication against LDAP is not working, and there is nothing in ldap log. What's wrong ?
Be sure ldap php module is installed ( on debian apt-get install php(4|5)-ldap ; apache(2)ctl graceful )
The login form asks for username and password, but only password matters.
Make sure you are not entering the admin password when testing the account because, if the password is equal to the admin password, it will authenticate directly through the config.php file and skip any other system.
Do note that even with AuthUser activated you can still log in with a blank username and only entering the password. In that case any password you enter will be "accepted" but only passwords which authenticate in the given context will actually give you any authorization rights. Using this capability AuthUser comfortably coexists with the default password-based system.
If you want to require both username and password, then you need to set an admin id before including authuser.php:
## Define usernames and passwords. $AuthUser['carol'] = '$1$CknC8zAs$dC8z2vu3UvnIXMfOcGDON0'; ## Enable authentication based on username. include_once('scripts/authuser.php'); # $DefaultPasswords['admin'] = crypt('secret'); $DefaultPasswords['admin'] = 'id:carol';
A username and password will then be required before login is successful.
Is there any way to hide IP addresses once someone has logged in so that registered users can keep their IP addresses invisible to everyone except administrators? - X 1/18/07
Not yet.
Is there a way that people could self-register through AuthUser?
You can see Cookbook:AuthUserSignup for a recipe about this problem.
I would like it that after I have AuthUser turned and a user is authenticated to get on my site, that if I have a password put on a particular page or group that they don't get the AuthUser form to show up (username and password), but only the typical field for password?
PasswordsAdmin
There seems to be a default password. What is it?
There isn't any valid password until you set one. Passwords admin 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, Cookbook:HtpasswdForm 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?
Enter '@lock' in GroupAttributes?action=attr to require an admin password for that group.
How do I edit protect, say, all RecentChanges pages?
How can I read password protect all pages in a group except the HomePage using configuration files?
As described in PmWiki.GroupCustomizations per-group or per-page configuration files should not be used for defining passwords. The reason is that per-group (or per-page) customization files are only loaded for the current page. So, if $DefaultPasswords['read']
is set in local/GroupA.php, then someone could use a page in another group to view the contents of pages in GroupA. For example, Main.WikiSandbox could contain:
- (:include GroupA.SomePage:)
and because the GroupA.php file wasn't loaded (we're looking at Main.WikiSandbox --> local/Main.php), there's no read password set.
How can I password protect the creation of new pages?
See Cookbook:LimitWikiGroups, Cookbook:NewGroupWarning, Cookbook:LimitNewPagesInWikiGroups.
How do I change the password prompt screen?
If your question is about how to make changes to that page... edit Site.AuthForm. If your question is about how to change which page you are sent to when prompted for a password, you might check out the Cookbook:CustomAuthForm for help.
How do I change the prompt on the attributes (?action=attr
) screen?
Simply create a new page at Site.AttrForm ?, and add the following line of code to config.php
:
$PageAttrFmt = 'page:Site.AttrForm';
Note that this only changes the text above the password inputs on the attributes page, but doesn't change the inputs themselves - the inputs have to be dealt with separately. See Cookbook:CustomAttrForm for more info.
I get http error 500 "Internal Server Error" when I try to log in. What's wrong?
This can happen if the encrypted passwords are not created on the web server that hosts the PmWiki.
The crypt function changed during the PHP development, e.g. a password encrypted with PHP 5.2 can not be decrypted in PHP 5.1, but PHP 5.2 can decrypt passwords created by PHP 5.1.
This situation normally happens if you prepare everything on your local machine with the latest PHP version and you upload the passwords to a webserver which is running an older version.
The same error occurs when you add encrypted passwords to local/config.php.
Solution: Create the passwords on the system with the oldest PHP version and use them on all other systems.
I only want users to have to create an 'edit' password, which is automatically used for their 'upload' & 'attr' passwords (without them having to set those independently). How do I do this?
By setting $HandleAuth
like so:
$HandleAuth
['upload'] = 'edit'; // And to prevent a WikiSandbox from having it's 'attr' permissions changed // except by the admin (but allowing editors to change it on their own pages/group) if(($group=="Site") || ($group=="Main") || ($group=="Category") || ($group=="SiteAdmin") || ($group=="PmWiki") ) {$HandleAuth
['attr'] = 'admin'; // for all main admin pages, set 'attr' to 'admin' password } else {$HandleAuth
['attr'] = 'edit'; // if you can edit, then you can set attr }
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 Design Notes and PmWiki:Hierarchical Groups.
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.
Does PmWiki support WYSIWYG editing (or something like the FCKEditor)?
Short answer: PmWiki provides GUI buttons in a toolbar for common markups, but otherwise does not have WYSIWYG editing. For the reasons why, see PmWiki:WYSIWYG.
This page may have a more recent version on pmwiki.org: PmWiki:FAQ, and a talk page: PmWiki:FAQ-Talk.