restricting filesystem access



Hi,

I am a new php user and I have a question, for which I couldn't find any
answer.

I'd like to restrict php code to access the filesystem. I'd like to have
only one directory where the php code can write, create or read files,
and an other directory hierarchy where the php codes present. I need
this to avoid php code to rewrite other php code in case of bug and/or
an attack.

I already tried the open_basedir directive, but it couldn't work because
in this case the executed php have to be in the accessable directory
hierarchy.

Thanks,
Gabor


.



Relevant Pages

  • Re: [PHP] restricting filesystem access
    ... only one directory where the php code can write, create or read files, ... and an other directory hierarchy where the php codes present. ... but if you run on shared server, i don't think you have a lot of ... if you afraid the php code to rewrite other code. ...
    (php.general)
  • Re: [PHP] restricting filesystem access
    ... I'd like to restrict php code to access the filesystem. ... and an other directory hierarchy where the php codes present. ... PHP runs as the Apache user. ... chown/chmod the source files to not be writable by that user. ...
    (php.general)