[pmwiki-users] Generating incorrect URLs

Patrick R. Michaud pmichaud at pobox.com
Mon Dec 4 12:13:50 CST 2006


On Sat, Dec 02, 2006 at 07:40:13PM -0500, Rik Sarkar wrote:
> 
> Your guess was correct, the server is not setting HTTP_HOST, it works if
> that is set. However, I am still stuck with it, because it does not work
> when I set it in local/config.php. It works only when set in pmwiki.php.
> Possibly, it is not reading the config.php.
> 
> Also, I am getting errors from the mkdirp($dir) function saying that it
> can't create wiki.d directory, though the directory exists with full
> access. 

This sounds to me as though PmWiki isn't being run from the correct
directory.  When the pmwiki.php script executes, it expects to be
running in the directory that contains local/ and wiki.d/ .
If the current directory is something else when pmwiki.php runs,
it'll be quite confused (and try to create a new environment
in whatever directory it happens to be in).

Note that the current directory isn't necessarily the one containing
pmwiki.php.  (For example, in farm installations, the current directory
is the one containing the local wiki field, while the farm contains
the pmwiki.php and other scripts.)

Getting back to the original issue, I generally recommend against messing
with HTTP_HOST or SCRIPT_NAME at all.  Simply set $ScriptUrl directly 
to whatever the url is supposed to be, rather than trying to figure 
it out (or have PmWiki figure it out) from whatever miscues are
coming from the webserver.

Pm




More information about the pmwiki-users mailing list