[pmwiki-users] Can any one help me

Patrick R. Michaud pmichaud at pobox.com
Sat Apr 2 09:17:56 CST 2005


On Sat, Apr 02, 2005 at 10:19:11PM +0800, Zhou Yuanchi wrote:
>    I just decompression the file into web root dictionary.
>     
>    After I chage the $ScriptUrl and $PubDirUrl to the correct set, it works.
>    But why the default set dosen't work?

Your PHP server doesn't seem to be setting a value for 
$_SERVER['SCRIPT_NAME'], thus PmWiki is unable to reliably
determine the url being used to access it.  Looks like on this
host you'll have to manually set $ScriptUrl and $PubDirUrl
in your local/config.php (indeed, that's the big reason these 
variables exist).  So, try setting those variables and see if
it works.

    $ScriptUrl = 'http://nkbbs.org/pmwiki/pmwiki.php';
    $PubDirUrl = 'http://nkbbs.org/pmwiki/pub';

-----

BTW, this particular host's settings are very instructive for those 
who often ask "Why doesn't PmWiki just use XYZ to set $ScriptUrl?"  
On this host, for the url
http://nkbbs.org/pmwiki/pmwiki.php/Main/HomePage?n=Main.HomePage&action=phpinfo

  PHP version     4.3.1
  SERVER_SOFTWARE Apache 1.3.31 (Unix)

  SCRIPT_NAME    (not set)
  PHP_SELF       (no value)
  REQUEST_URI    /pmwiki/pmwiki.php/Main/HomePage?n=Main.HomePage&action=phpinfo
  SCRIPT_URL     /pmwiki/pmwiki.php/Main/HomePage
  SCRIPT_URI     http://nkbbs.org/pmwiki/pmwiki.php/Main/HomePage
  PATH_INFO      (not set)

Compare this to pmwiki.org:

  PHP version     4.3.2
  SERVER_SOFTWARE Apache/2.0.46 (Red Hat)
  
  SCRIPT_NAME     /wiki
  PHP_SELF        /wiki/Main/HomePage
  REQUEST_URI     /wiki/Main/HomePage?n=Main.HomePage&action=phpinfo
  SCRIPT_URL      (not set)
  SCRIPT_URI      (not set)
  PATH_INFO       /Main/HomePage

As you can see, there doesn't appear to be a set of variables that
a script such as PmWiki can reliably use in every environment to correctly
determine the script's url and the pathinfo string (the part after the
script name but before any query string).  Thus, PmWiki has to 
"guess" at the correct answers (and sometimes those guesses turn out to 
be wrong).

Pm



More information about the pmwiki-users mailing list