PmWiki /
FAQThis 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. IntroductionWhat 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. How do you pronounce "Michaud"? "Michaud" is french pronounced "mee show", the trailing D is silent. ImagesWhy are some external images correctly embedded, and others aren't? If the current page is on a secure URL with the "https://" protocol, some browsers will refuse to load pictures from insecure URLs (the other way around is allowed). Also, some webmasters configure their servers to disallow hotlinking. Is it possible to link an image on PmWiki without using a fully qualified URL? Yes. For images that are attachments, the general format is Can I attach a client image file on PmWiki? Yes, see Uploads . How can I include a page from another group that contains an attached image? Include the page in the normal way, ie Why, if I put an image with rframe or rfloat and immediatly after that I open a new page section with ! the section title row is below the image instead of on the left side? Because the CSS for headings such as ! contains an element clear:both which forces this behaviour. Redefine the CSS locally if you want to stop this happening, but I think the bottom border (that underlines the heading) would need further re-definition. I just use bolding for the title, and 4 dashes below Unlike the lframe and rframe directives, cframe does not fully honour the width setting. While the frame itself resizes to match the request, the enclosed image does not, and retains its original width. Effect is the same in IE and Fx. I've added an example beneath the standard example above. Is it possible to disallow all images? I already disabled uploads but I also want to disallow external images from being shown on my wiki pages. Yes, add to DisableMarkup('img'); $ImgExtPattern = "$^"; How can I make it so that when I place an image in a page, the block of text it is in is a If you just want it to happen for a single image (instead of all), then
try putting [==] https://www.pmwiki.org/pub/pmwiki/pmwiki-32.gif
Having Is there any way to use relative paths for images? See Cookbook:RelativeLinks and $EnableLinkPageRelative. Is there a way to attach a BMP and have it display rather than link? Add to How do I add an image type to You can append the extensions to the Is there a way to have a table to the left or right of an image? Yes, see TableAndImage. UploadsWhen I upload a file, how do I make the link look like "file.doc" instead of "Attach:file.doc Δ"? Use parentheses, as in 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 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.
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 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 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 See Cookbook:Prevent Hotlinking How can I display a file that lacks a correct extension? (e.g. you are using Cookbook:LinkIcons) A file can be displayed by addition of a "false" extension to the URL. For example, if the url is PageDirectives Can I get Use Is there any way to prevent the "redirected from" message from showing at the top of the target page when I use From version 2.2.1 on, set in 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}:)?
(:redirect Goodgroup.{$Name}:) works if you want to put it in one page.
If you want it to work for the entire group, put (:redirect Goodgroup.{*$Name}:) into Badgroup.GroupHeader - however, that only works with pages that really exist in Goodgroup ; if you visit a page in Badgroup without a corresponding page of the same name in Goodgroup , instead of being redirected to a nonexistant page, you get the redirect Directive at the top of the page.
With (:if exists Goodgroup.{*$Name}:)(:redirect Goodgroup.{*$Name}:)(:ifend:) in Badgroup.GroupHeader you get redirected to Goodgroup.Name if it exists, otherwise you get Badgroup.Name without the bit of code displayed.
How can a wiki enable linebreaks by default, i.e. without having the directive Add to IncludeOtherPagesWhat's the maximum number of includes that can exist in a page? My site seems to stop including after 48 includes. ($MaxIncludes)
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. (Two of these are GroupHeader and GroupFooter.) The limit can be modified by the wiki administrator via the $MaxIncludes variable. Is there any way to include from a group of pages without specifying by exact name, e.g. between Anchor X and Y from all pages named IFClass-* ? This can be achieved using page lists. There appears to be a viewing issue when the included page contains the (:title:) directive. In a default installation, the last title in the page overrides previous ones so you can place your (:title :) directive at the bottom of the page, after any includes. See also $EnablePageTitlePriority. How to test to see if the page is part of another page?
Is there any way to include (chapters of) pages which are protected (authuser.php)? You can achieve this the other way around: have the public sections in a public page (passwdread=@nopass or @_site_read) and include those into both the protected page, and the public page. Note that it is strongly recommended to NOT hide sensitive content inside a conditional in an unprotected page. WikiTrails
What's the difference between a PageList and a WikiTrail? The pagelist directive dynamically generates a list of pages. There are many ways to generate the list, including using a WikiTrail as the source. PageHistoryIs 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 3. Edit the page. Select all the contents of the edit text area and cut them to the clipboard. Enter How can I restrict viewing the page history In the $HandleAuth['diff'] = 'edit' ;
In case of this restriction is set up on a farm, and you want to allow it on a particular wiki, set in your $HandleAuth['diff'] = 'read' ;
PmWiki InstallationShould I rename pmwiki.php to index.php? Renaming pmwiki.php is not recommended. Instead, create an index.php file that contains this single line <?php include_once('pmwiki.php');
How do I make pmwiki.php the default page for a website? Create an index.php file that runs PmWiki from a subdirectory (pmwiki/ for example) and place it in the site's web document root (the main directory for the website). <?php chdir('pmwiki'); include_once('pmwiki.php');
Note: You will also need to explicitly set the $PubDirUrl variable (e.g. to How do I enable "Clean URLs" that are shorter and look like paths to my wiki pages? Why does pmwiki.org appear to have a directory structure rather than "?n=pagename" in URLs? See Cookbook:CleanUrls. How can I run PmWiki on a standalone (offline, portable) machine ? UpgradesHow can I determine what version of PmWiki I'm running now? See version - Determining and displaying the current version of PmWiki (pmwiki-2.3.25). How can I test a new version of PmWiki on my wiki without changing the prior version used by visitors? The easy way to do this is to install the new version in a separate
directory, and for the new version set (in $WikiLibDirs = array(&$WikiDir, new PageStore('/path/to/existing/wiki.d/{$FullName}'), new PageStore('wikilib.d/{$FullName}')); This lets you test the new version using existing page content without impacting the existing site or risking modification of the pages. (Of course, any recipes or local customizations have to be installed in the new version as well.) Then, once you're comfortable that the new version seems to work as well as the old, it's safe to upgrade the old version (and one knows of any configuration or page changes that need to be made). SecurityHow do I report a possible security vulnerability of PmWiki? Pm wrote about this in a post to pmwiki-users from September 2006. In a nutshell he differentiates two cases:
See his post mentioned above for details and rationals. What about the botnet security advisory at https://isc.sans.edu/diary/Reports+of+Bots+exploiting+pmwiki+and+tikiwiki/1672? Sites that are running with PHP's register_globals setting set to "On" and versions of PmWiki prior to 2.1.21 may be vulnerable to a botnet exploit that is taking advantage of a bug in PHP. The vulnerability can be closed by turning register_globals off, upgrading to PmWiki 2.1.21 or later, or upgrading to PHP versions 4.4.3 or 5.1.4. Wiki Vandalism and Spam
How do I stop pages being deleted, eg password protect a page from deletion? Use Cookbook:DeleteAction and password protect the page deletion action by adding or $HandleAuth['delete'] = 'admin'; to require the edit or admin password respectively.
How do I stop pages being replaced with an empty (all spaces) page? Add how do I stop pages being completely replaced by an inane comment such as excellent site, great information, where the content cannot be blocked? Try using the newer automatic blocklists that pull information and IP addresses about known wiki defacers. (OR) Try using Cookbook:Captchas or Cookbook:Captcha (note these are different). (OR) Set an edit password, but make it publicly available on the Site.AuthForm template. How do I password protect the creation of new groups? See Cookbook:Limit Wiki Groups How do I password protect the creation of new pages? See Cookbook:Limit new pages in Wiki Groups How do I take a whitelist approach where users from known or trusted IP addresses can edit, and others require a password? Put these lines to ## Allow passwordless editing from own turf, pass for others. if ($action=='edit' && !preg_match("/^90\\.68\\./", $_SERVER['REMOTE_ADDR']) ) { $DefaultPasswords['edit'] = pmcrypt('foobar'); } Replace For a single IP, you may use if($_SERVER['REMOTE_ADDR'] == '127.0.0.1') { # your IP address here $_POST['authpw'] = 'xxx'; # the admin password } Please note the security issues: this means that you have your admin passwords in clear in See also Cookbook:AuthDNS & Cookbook:PersistentLogin How do I password protect page actions? See Passwords for setting in $HandleAuth['pageactionname'] = 'pageactionname'; # along with :
$DefaultPasswords['pageactionname'] = pmcrypt('secret phrase');
or $HandleAuth['pageactionname'] = 'anotherpageactionname';
How do I moderate all postings? Enable PmWiki.Drafts
How do I make a read only wiki? In How do I restrict access to uploaded attachments? See
How do I hide the IP addresses in the "diff" pages? If the user fills an author name, the IP address is not displayed. To require an author name, set in $EnablePostAuthorRequired = 1; The IP address can also be seen in a tooltip title when the mouse cursor is over the author name. To disable the tooltip, set in $DiffStartFmt = "<div class='diffbox'><div class='difftime'><a name='diff\$DiffGMT' href='#diff\$DiffGMT'>\$DiffTime</a> \$[by] <span class='diffauthor'>\$DiffAuthor</span> - \$DiffChangeSum</div>"; How do I stop some Apache installations executing a file which has ".php", ".pl" or ".cgi" anywhere in the filename Use $UploadBlacklist How do I stop random people from viewing the ?action=source (wiki markup) of my pages? I have See $EnableCookieSecure and $EnableCookieHTTPOnly How do I set a global password to resist spambots, and informed humans of the password? CustomMarkupHow 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 <script> statements can be inserted using the $HTMLHeaderFmt array. How would I create a markup ( Add the following section of code to your SDV($HideDiscussion, 0); #define var name Markup('hideDiscussion', '<{$var}', '/\\(:nodiscussion:\\)/', 'setHideDiscussion'); function setHideDiscussion() { global $HideDiscussion; $HideDiscussion = true; } This will enable the It appears that (.*?) does not match newlines in these functions, making the above example inoperable if the text to be wrappen in <em> contains new lines. If you include the "s" modifier on the regular expression then the dot (.) will match newlines. Thus your regular expression will be "/STUFF(.*?)/s". That s at the very end is what you are looking for. If you start getting into multi-line regexes you may be forced to look at the m option as well - let's anchors (^ and $) match not begin/end of strings but also begin/end of lines (i.e., right before/after a newline). Also make sure your markup is executed during the fulltext phase. How can the text returned by my markup function be re-processed by the markup engine? If the result of your markup contains more markup that should be processed, you have two options. First is to select a "when" argument that is processed earlier than the markup in your result. For example, if your markup may return [[links]], your "when" argument could be How do I get started writing recipes and creating my own custom markup? (alternate) Introduction to custom markup for Beginners How do I make a rule that runs once at the end of all other rule processing? Use this statement instead of the usual
Category: Markup Internationalizations If my wiki is internationalized by Use If my wiki is in English and I want just one page, or group, in Spanish do I say 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 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 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-ca', 'PmWikiFrCa.XLPage'); XLPage('fr', 'PmWikiFr.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 $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(). How can I add a translation for an individual string in a PHP file? Use the XLSDV() function to provide a translation for a specific (English) string. For instance, with this in XLSDV('nl', array('my English expression'=>'mijn Nederlandse uitdrukking'));
any instance of the variable expression If you need to get a translation in a PHP file, use the $local_string = XL("my English expression");
But beware: LocalCustomizations There's no " The " Can I change the default page something other than 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';
Note the recommendations in $DefaultName and the need to set $PagePathFmt as well if you are changing the default startup page for groups. How do I get the group / page name in a local configuration file (e.g. 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'); Note the importance of the order of customizations in If you need the verbatim group and page name (from the request) early in
according to this posting Can I remove items from the wikilib.d folder on my site? The files named Site.* and SiteAdmin.* contain parts of the interface and the configuration and they should not be removed. The other files named PmWiki* contain the documentation and could be removed. 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, see Order of the commands in I have an online hosted wiki, and a local copy on my home computer. How can I differentiate in config.php whether I'm online or on the local computer? So that I don't have to maintain the config.php twice. You can try something like the following: if($_SERVER['SERVER_ADDR'] == '127.0.0.1') { # Home wiki } else { # Online wiki } You can add The $_SERVER variable will have different values on the different servers, notably 'SERVER_ADDR' or 'SERVER_NAME'. You can configure the different wikis based on the different values. GroupCustomizationsHow can I apply CSS styles to a particular group or page? Simply create a Why shouldn't passwords be set in group (or page) customization files? Why shouldn't group or page passwords be set in The reason for this advice is that per-group customization files are only loaded for the current page. So, if
and because the 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 above (using SkinsHow do I change the Wiki's default name in the upper left corner of the Main Page? Put the following $WikiTitle = 'My Wiki Site';
The 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 SkinTemplatesHow do I customize the CSS styling of my PmWiki layout? See Skins for how to change the default PmWiki skin. See also 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 $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 Can I easily hide the Home Page title from the homepage? Yes, you can use in the wiki page either Is it possible to hide the Search-Bar in the default PmWiki Skin? Yes, please see Cookbook:HideSearchBar. AuthUser Can I specify authorization group memberships from with Yes -- put the group definition into the $AuthUser array (in $AuthUser['@editors'] = array('alice', 'carol', 'bob');
Can I have multiple admin groups? Yes, define the groups with $DefaultPasswords['admin'] = array( pmcrypt('masterpass'), # global password '@admins', '@moderators', # +users in these groups 'id:Fred', 'id:Barney'); # +users Fred and Barney 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 setting seems correct, authentication against LDAP is not working. 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. Username can be left blank and it still signs in under the account. Is this intentional and if so, can I change it so that the username and password must both be entered? - X 1/18/07 Never mind I think this has something to do with using the admin password. I created a test account and it's working ok.
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 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 ## Define usernames and passwords. $AuthUser['carol'] = '$1$CknC8zAs$dC8z2vu3UvnIXMfOcGDON0'; ## Enable authentication based on username. include_once('scripts/authuser.php'); # $DefaultPasswords['admin'] = pmcrypt('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 Yes, see solution provided at PITS:00400. Is there a way that people could self-register through AuthUser? You can see HtpasswdForm or UserAdmin for recipes providing this feature. 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? See this thread of the mailing list (authuser vs passwords). How to allow a group or a page for reading or editing, only to signed-in users? You can set the password fields to PasswordsAdminThere 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 How do I use passwd-formatted files (like .htpasswd) for authentication? See AuthUser, Cookbook:HtpasswdForm or Cookbook:UserAuth2. Is there anything I can enter in a Enter '@lock' in How do I edit protect, say, all RecentChanges pages? How can I read password protect all pages in a group except the 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
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 ( Simply create a new page at Site.AttrForm?, and add the following line of code to
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. 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['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 } DesignNotesWhy 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. See also Cookbook:Worse and Cookbook:PmSyntax. Categories: PmWiki Developer
This page may have a more recent version on pmwiki.org: PmWiki:FAQ, and a talk page: PmWiki:FAQ-Talk. |