From DreamHost
Revision as of 14:52, 12 May 2010 by Javierrod (Talk | contribs)

Jump to: navigation, search

PmWiki is a WikiWikiWeb system developed by Patrick Michaud in the PHP scripting language. PmWiki has been primarily designed as a tool to support easy, collaborative authoring and maintenance of web sites.

To get PmWiki to work with DreamHost you have to change the following line in pmwiki.php:

$ScriptUrl = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'];

$ScriptUrl = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];

dsteven adds: The second line for $ScriptUrl works, but pmwiki won't work properly without the $PubDirUrl variable set. Here's the two lines relating to $ScriptUrl and $PubDirUrl that I have in my local/config.php and pmwiki works great for me:

$ScriptUrl = '';

$PubDirUrl = '';

erisraven adds: I tried dsteven's solution, and it was successful in resolving my issues.

eargang adds: dsteven's solution is kind of crude, and involves manual editing. however, it does get one thing right - you don't have to edit pmwiki.php, which is something that the author recommends against anyway in his installation instructions. To be honest, I'd stay out of the code alltogether if you're into organized (MVC or not) style PHP code, because the codebase of PmWiki is everything but organized.

So, if you combine the orgiginal suggestion with dsteven's suggestion, do this:

edit local/config.php and add:

$ScriptUrl = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];

$PubDirUrl = preg_replace('#/[^/]*$#','/pub',$ScriptUrl,1);

and voila.

eargang adds one more: and if you want to use mod_rewrite on your pmwiki setup, this is the way to modify your config.php:

//mod_rewrite fix:

$ScriptUrl = 'http://'.$_SERVER['HTTP_HOST'];

$PageUrlFmt = 'http://'.$_SERVER['HTTP_HOST'].'/$Group/$Title_';

$PubDirUrl = 'http://'.$_SERVER['HTTP_HOST'].'/pub';

$UploadUrlFmt = 'http://'.$_SERVER['HTTP_HOST'].'/uploads';

$EnablePathInfo = 1;

then, create a .htaccess file in the root of your pmwiki install and edit it to read:

DirectoryIndex pmwiki.php index.php index.html index.cgi

RewriteEngine on

RewriteBase /

RewriteRule ^([A-Z].*) /home/yourusername/url_for_your_pmwiki/pmwiki.php?pagename=$1 [L,qsappend]

happybuddha adds: I have implemented dsteven's suggestion with SUCCESS. Tried SO many things before that...almost gave up on the installation.

kway adds:

About the mod_rewrite solution above, note that the RewriteBase needs to be the relative directory where your pmwiki.php file is found. For example, if you have it in your /wiki directory, it should read

RewriteBase /wiki