[pmwiki-users] Generating incorrect URLs

Rik Sarkar rik at cs.sunysb.edu
Tue Dec 5 16:00:16 CST 2006


This looks promising, how do I find the username of phpowner ?

Thanks.

Rik

On Tue, 5 Dec 2006, Michael Brenner wrote:

> Hi again,
>
> on  php.net[3] someone wrote this[1], even so I don't have such problems with
> safe_mode with the same setup.  Probably paranoid config[2] in php.ini.
>
> [1]--------------
>  stefan at horn dot nl
> 12-Jul-2006 08:30
> file_exists and safe_mode
>
> file_exists under safe_mode works (I work with for php 4) doesn't work when
> owner of the dir where the file stands differs from the php-owner.
>
> e.g. file_exists in this dir will give FALSE nevertheless the file exists
>
> rights          owner  dir
> drwxr-xr-x    apache  images
>
> change the owner of the dir to the phpowner and file_exists works.
>
> I spent too much time to discover. Hope it will spare a lot of your time.
>
> Stefan
>
> [2]--------------
> http://de.php.net/manual/en/features.safe-mode.functions.php
>
> [3]--------------
> http://de.php.net/manual/en/function.file-exists.php
>
> Am Dienstag, 5. Dezember 2006 03:40 schrieben Sie:
> > On Mon, 4 Dec 2006, Patrick R. Michaud wrote:
> > > On Mon, Dec 04, 2006 at 06:30:22PM -0500, Rik Sarkar wrote:
> > > > > Is there a url we could look at?  And perhaps you could set
> > > > > $EnableDiag=1; ?
> > > >
> > > > Sure. url : http://www.cs.sunysb.edu/~rik/pmwiki/pmwiki.php
> > > > I have set $EnableDiag=1; at the begininng of pmwiki.php
> > >
> > > Hmm.  The error message I'm seeing says:
> > >
> > >     Warning: mkdir() failed (File exists) in
> > >     /home/stufs1/rik/public_html/pmwiki/pmwiki.php on line 436.
> > >
> > > That's really weird.  So, the questions are:
> > >
> > >     - does wiki.d/ exist?
> >
> > yes.
> >
> > >     - what are the ownerships/permissions on wiki.d/
> > >     - what are the ownerships/permissions on the pmwiki/ directory
> >
> > both owned by user. Initially I had a+rwx only on wiki.d/ now I think
> > there is rwx for everyone everywhere inside pmwiki/ subtree
> >
> > > and, while we're at it
> > >
> > >     - what are the ownerships/permissions on local/ ?
> >
> > Same.
> >
> > > Pm
> > >
> > > > On Mon, 4 Dec 2006, Patrick R. Michaud wrote:
> > > > > On Mon, Dec 04, 2006 at 05:47:23PM -0500, Rik Sarkar wrote:
> > > > > > > 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.
> > > > >
> > > > > Is there a url we could look at?  And perhaps you could set
> > > > > $EnableDiag=1; ?
> > > > >
> > > > > It's very odd that "system('pwd')" works, I'm wondering if the PHP
> > > > > on that system has been configured to block access to the filesystem
> > > > > somehow.  But I guess not if mkdirp() is running.
> > > > >
> > > > > Out of curiosity, what version of PHP?
> > > > >
> > > > > Pm
> > > > >
> > > > > > 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