Re: mkdir() and safe_mode



Markus wrote:
Hello

I ran into the commonly known problem that under safe_mode it is possible to create a directory with mkdir(), but impossible to create a subdirectory inside the first one:

1 $path = $_SERVER['DOCUMENT_ROOT'].'/cache';
2 mkdir($path, 0755);
3 chmod($path, 0777);
4 mkdir($path.'/subdir', 0755);
[snip]

The classic way to work around a "safe mode" is to create your php files dynamically instead of uploading them. I.e. you upload one single "unroll" script that generates all worker scripts and saves them to files. Since those generated scripts are owned by apache, they won't have any trouble accessing files that they create.


--
gosha bine

extended php parser ~ http://code.google.com/p/pihipi
blok ~ http://www.tagarga.com/blok
.



Relevant Pages

  • Re: mkdir() and safe_mode
    ... I ran into the commonly known problem that under safe_mode it is possible to create a directory with mkdir(), but impossible to create a subdirectory inside the first one: ... dynamically instead of uploading them. ... Since those generated scripts are owned by apache, they won't have any trouble accessing files that they create. ...
    (comp.lang.php)
  • Re: create database fatal error
    ... CREATE DATABASE statement i run the catalog.sql and catproc.sql scripts. ... mkdir -p $/pfile ...
    (comp.databases.oracle.server)
  • Re: SQLPLus Host command shortcut
    ... I have some deploy scripts ... On the Unix environment it works well but on the windows environment I ... using the shortcut of: $mkdir.. ... HOST mkdir but was just wondering if I could change ...
    (comp.databases.oracle.misc)
  • Re: SQLPLus Host command shortcut
    ... I have some deploy scripts ... On the Unix environment it works well but on the windows environment I ... using the shortcut of: $mkdir.. ... HOST mkdir but was just wondering if I could change ...
    (comp.databases.oracle.misc)
  • VNC on OpenServer
    ... I've been working hard to get VNC working on OpenServer. ... these scripts don't address the Java client. ... tar xvf ../bash-2.03-VOLS.tar ... mkdir /usr/X11R6/lib ...
    (comp.unix.sco.misc)