Safe mode question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • while_1

    Safe mode question

    I have a program (site_bot, found at phpclasses.org)
    that


    1) recursively reads a file system starting at
    locationA, and stores lots of filesystem info
    in a mysql schema on the fly.

    2) mirrors the directory structure found at locationA
    to locationB

    3) processes the info in the schema and writes static
    html code into the mirrored directory structure
    at locationB.

    This code works flawlessly at several (edu) sites where
    the nefarious safe_mode is Off. I recently tried
    to set this code up on in commercial virtual host
    environment, and ran into catch22 at every step.

    With safe_mode On, user apache cannot mkdir recursively
    inside a filesystem that belongs to login user.
    If I chown the program code and the write_to directory
    so they belong to the apache pseudo user, then the
    apache process has the requisite write access, but
    fails when trying to read the source directory (locationA).
    chmod 777 on the source dir doesn't seem to fix the
    read access problem (for user apache).

    This is a showstopper, because the whole system
    revolves around the user's ability to add images,
    text files and html fragments to locationA (to
    become generated html).

    If the host provider refuses to turn off safe_mode,
    is there any other way to (to set file permissions
    or whatever) so php with safe mode can read from
    user files and write the server side file system.

    My host provider doesn't even seem to understand
    the problem, let alone know how to fix it.
  • iuz

    #2
    Re: Safe mode question

    while_1 wrote:
    [color=blue]
    > I have a program (site_bot, found at phpclasses.org)
    > that
    >
    >
    > 1) recursively reads a file system starting at
    > locationA, and stores lots of filesystem info
    > in a mysql schema on the fly.
    >
    > 2) mirrors the directory structure found at locationA
    > to locationB
    >
    > 3) processes the info in the schema and writes static
    > html code into the mirrored directory structure
    > at locationB.
    >
    > This code works flawlessly at several (edu) sites where
    > the nefarious safe_mode is Off. I recently tried
    > to set this code up on in commercial virtual host
    > environment, and ran into catch22 at every step.
    >
    > With safe_mode On, user apache cannot mkdir recursively
    > inside a filesystem that belongs to login user.
    > If I chown the program code and the write_to directory
    > so they belong to the apache pseudo user, then the
    > apache process has the requisite write access, but
    > fails when trying to read the source directory (locationA).
    > chmod 777 on the source dir doesn't seem to fix the
    > read access problem (for user apache).
    >
    > This is a showstopper, because the whole system
    > revolves around the user's ability to add images,
    > text files and html fragments to locationA (to
    > become generated html).
    >
    > If the host provider refuses to turn off safe_mode,
    > is there any other way to (to set file permissions
    > or whatever) so php with safe mode can read from
    > user files and write the server side file system.
    >
    > My host provider doesn't even seem to understand
    > the problem, let alone know how to fix it.[/color]

    with ftp functions
    ftp_mkdir($reso urce_link, $needed_directo ry);
    ftp_site($resou rce_link, 'CHMOD 0777 $needed_directo ry');

    i have sent an email to you at sandy@......

    --
    iuz-lab.info is your first and best source for all of the information you’re looking for. From general topics to more of what you would expect to find here, iuz-lab.info has it all. We hope you find what you are searching for!

    Comment

    Working...