[pmwiki-users] Generating incorrect URLs

Rik Sarkar rik at cs.sunysb.edu
Mon Dec 4 16:47:23 CST 2006


> This sounds to me as though PmWiki isn't being run from the correct
> directory.

That was my guess too. But even setting the $ScriptUrl directly does not
help. The URLs generated now are correct, but it still does not
find the wiki.d directory and gives the error. It seems to me that while
the things accessed through url are fine, the access to the local file
system is a problem. Any simple way to fix that ? doing system('pwd')
returns correct values, and I ran the mkdirp() function in a trial script
of my own in the same directory, and it worked fine.

Thanks for your help any way. This is a nice piece of software, so I
really wanted to use it.

Rik.

On Mon, 4 Dec 2006, Patrick R. Michaud wrote:

> 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