'; SDV($GUIButtons['ASCIIsvg'],array(1000, '\\\begin{graph} ', ' \\\end{graph}', 'width=300; height=200; xmin=-6.3; xmax=6.3; xscl=1; plot(sin(x));', '$ASCIIMathMLUrl/graph.gif"$[ASCIIsvg-graph]"')); SDV($GUIButtons['ASCIImath'],array(1000, '', '', 'sqrtn', '$GUIButtonDirUrlFmt/math.gif"$[Math formula (ASCIIMath)]"')); Math etc - FAQ

# FAQ

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.

## Basic PmWiki editing rules

Q: I'm new to PmWiki, where can I find some basic help for getting started? A: The 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.

Q: How do I include special characters on my wiki pages? A: Use character codes to insert special characters, such as Copyright (©) and Trademark (® or ™) symbols, that don't appear on your keyboard.

Q: Why are separate lines of text in the markup combined into a single line on output? A: 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. However, an author can use the (:linebreaks:) directive to cause separate lines of markup text to be kept as separate lines in the output.

Q: Can I just enter HTML directly? A: 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 PmWikiPhilosophy and PmWiki:Audiences. Basically, Pm feels that enabling HTML markup within wiki pages in a collaborative environment has the effect of excluding some potential authors from being able to edit pages, as well as posing a number of display and security issues. However, a site administrator can use the Cookbook:EnableHTML recipe to enable the use of HTML markup directly in pages.

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

A: Use the %newwin% wikistyle, as in:

 %newwin%http://www.example.com/ http://www.example.com/(approve sites)

Q: How do I place a mailing address in a page?

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

    mailto:myaddress@example.com


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

A: Use link markup. There are two formats:

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


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

A: 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 Q: How do I link to an uploaded file or image from another group? A: Use Attach:Groupname./filename.ext . Note the extra dot after the group name. Q: When I upload a file, how do I make the link look like "file.doc" instead of "Attach:file.doc"? A: Use parentheses, as in [[(Attach:)file.doc]]. There is also a configuration change that can eliminate the Attach: -- see Cookbook:AttachLinks. Q: Why can't I upload files of size more than 50kB to my newly installed PmWiki? A: 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.

Q: Who does my upload exit unexpectedly with "Incomplete file received"? A: 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

Q: How do I create nice tables similar to Product X? A: See tables and table directives.

## Table Directives

Q: Can I define table headers using the table directive markup? A: No, but you can with Cookbook:AdvancedTableDirectives. See Pm's reply to pending PITS:00535

## WikiStyles

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

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

## PageDirectives

Q: Can I get (:redirect:) to return a "moved permanently" (HTTP 301) status code? A: Use (:redirect PageName status=301:).

Q: Is there any way to prevent the "redirected from" message from showing at the top of the target page when I use (:redirect:)? A: 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

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

A: 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 Q:Is there a variable like$LastModified, but which shows me the creation time? A: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"])';

## WikiGroup

Q: How can I get rid of the 'Main' group in urls for pages pointing to Main?

A: See Cookbook:GetRidOfMain.

Q: How can I limit the creation of new groups?

A: See Cookbook:LimitWikiGroups.

Q: How do I set one header for all pages/groups? A: The header for each page is controlled by the $GroupHeaderFmt variable. Thus a site-wide groupheader can be added with $GroupHeaderFmt = '(:include {$SiteGroup}.SiteHeader basepage={*$FullName}:)(: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)

A: Any form of markup is valid in $GroupHeaderFmt, thus one can do $GroupHeaderFmt .= "Global markup text here.";

## PageHistory

Q: Is there a way to remove page history from page files? A: 1. Administrators can clean page histories using the Cookbook:ExpireDiff recipe.

A: 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.

A: 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.

Q: How can I restrict viewing the page history to people with edit permission? A: In the local/config.php file, set

$HandleAuth['diff'] = 'edit'; ## Passwords Q: 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? A: 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');


Q: 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?

A: 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

Q: How can I configure my site to always exclude wiki-related pages from searches? A: 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\\.!';


$name = PageVar($pagename, '$Name');  Q: Can I remove items from the wikilib.d folder on my site? A: 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); Q: How do I customize my own 404 error page for non-existent pages? A: To change the text of the message, try editing the Site.PageNotFound page. ## Skins Q: How do I change the Wiki's default name in the upper left corner of the Main Page? A: Put the following config.php $WikiTitle = 'My Wiki Site';

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

Q: How can I embed PmWiki pages inside a web page?

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

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

A: 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.

Q: How can I test a new version of PmWiki on my wiki without changing the prior version used by visitors? A: The easy way to do this is to install the new version in a separate directory, and for the new version set (in local/config.php):


$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).

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

        $AuthUser['@editors'] = array('alice', 'carol', 'bob');  Q: 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? A: This is caused by the way that PHP treats sessions. See PmWiki.AuthUser#sessions for more details. Q: How can I access the authorization groups that the current user belongs to in order to test using that as a condition of an if statement? Q: Is there any way to have groups inherit other groups (e.g. @fruits: @apples, @oranges, jack)? Q: Is it possible to list more than one .htpasswd and .htgroup file to be used? e.g. if I am running a wikifarm and some users are common across various fields, it would be nice if they only needed to update their password once. Sure I could merge all the passwd & group files, but then I wouldn't be able to support identical user or group names on each independent wikifield.. Q: 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. A: I wrote a recipe to do something like this. It records the last action for each user (not necessarily just login actions). See Cookbook:UserLastAction for more info. --Lordmundi March 23, 2007 Q: I want to allow anyone to edit my wiki, but don't want anyone else to use my name as the author. Is there a way to "reserve" and password protect certain usernames? Or basically just require a password when attempting to edit a page with a registered user's name in the author field? ## Uploads Administration Q: How do I disable uploading of a certain type of file? A: 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.

Q: How do I attach uploads to individual pages or the entire site, instead of organizing them by wiki group? A: Use the $UploadPrefixFmt variable (see also the Cookbook:UploadGroups recipe). $UploadPrefixFmt = '/$FullName'; # per-page $UploadPrefixFmt = ''; # site-wide

Q: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 A: Units are in bytes. 100K:$UploadDirQuota =        100000;
1MB: $UploadDirQuota = 1000000; 1GB:$UploadDirQuota =    1000000000;

## Custom InterMap

Q: Are InterMap names case sensitive?

A: Yes, thus eAdmin: is a different InterMap link than EAdmin:.

Q: How can I achieve a localmap.txt mapping with the effect of Pics: Path:/somepathto/pics/?

A: Use the following:

Pics: /somepathto/pics/

## CustomMarkup

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

A: 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. ## WebFeeds Q: How can I use the RSS <enclosure> tag for podcasting? A: 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.

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

A: Add this line in you local/config.php

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

Q: How to add feed image?

A: Add the following to local/config.php (this example is for ?action=rss):

$FeedFmt['rss']['feed']['image'] = "<title>Logo title</title> <link>http://www.example.com/</link> <url>http://www.example.com/images/logo.gif</url> <width>120</width> <height>60</height>";  Q: How do I insert RSS news feeds into PmWiki pages? A: See Cookbook:RssFeedDisplay. Q: How can I specify default feed options in a configuration file instead of always placing them in the url? A: 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));  ## Troubleshooting Q: Why am I seeing strange errors after upgrading? A: Make sure all of the files were updated, in particular pmwiki.php. A: 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. A: 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. A: 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/.) Q: I'm suddenly getting messages like "Warning: fopen(wiki.d/.flock): failed to open stream: Permission denied..." and Cannot acquire lockfile"... what's wrong? A: 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) Q: 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? A: 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. Also: Make sure you type SideBar with a capital B. Q: Why am I seeing "Warning: Cannot modify header information - headers already sent ..." messages at the top of my page. A: 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. A: If the warning is appearing after some other warning or error message, then resolve the other error and this warning may go away. Q: Why is PmWiki prompting me multiple times for a password I've already entered? A: 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).

Q: 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."

A: 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.

Q: 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?

A: 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).

Q: Some of my posts are coming back with "403 Forbidden" errors or "Not Acceptable"? This happens with posts containing "wget", "curl", "file(" or ...

A: Your webserver probably has mod_security(approve sites) 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", and "file(", 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.

Q: 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.

A:

## DesignNotes

Q: Why doesn't PmWiki use hierarchical / nested groups? A: 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.

Q: Why don't PmWiki's scripts have a closing ?> tag? A: 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(approve sites) page in the PHP manual(approve sites).

Q: Does PmWiki support WYSIWYG editing (or something like the FCKEditor)? A: 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.

## AccessKeys

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

A: See PmWiki.AccessKeys.

## Security

A: 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. In addition, there is a test at PmWiki:SiteAnalyzer that can be used to determine if your site is vulnerable.

## SkinTemplates

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

A: 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; }';

Q: Where can the mentioned "translation table" be found for adding translated phrases?

A: See Internationalizations.