467,171 Members | 1,266 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,171 developers. It's quick & easy.

safe_mode and mkdir in a loop

I have a script that wants to mirror
a directory structure, reading
from location1 and writing (mkdir) at location2.

This code works fine on a my own desktop test box.
But fails at 'mkdir' when run on virtualhost box
with safe_mode enabled and virtual (chrooted?)
filesystems.

My script makes the first top-level directory just
fine, but fails on subsequent, nested mkdirs,
producing the error message:

Warning: mkdir(): SAFE MODE Restriction in effect. The script whose
uid is 669 is not allowed to access /home/virtual/site...path to dir I
just made

There must be a solution.
chmod($newdir, 0777) doesn't
seem to help.

Php has to solve the lack-of-suexec-behavior problem,
somehow, someway. Else it's a make believe system,
at least in the virtualhost environment.
Jul 17 '05 #1
  • viewed: 2214
Share:
2 Replies
In article <a8**************************@posting.google.com >, Salmo Bytes wrote:
My script makes the first top-level directory just
fine, but fails on subsequent, nested mkdirs,
producing the error message:

Warning: mkdir(): SAFE MODE Restriction in effect. The script whose
uid is 669 is not allowed to access /home/virtual/site...path to dir I
just made
If you create a new directory, the owner of that directory is the user
that runs the webserver (usually www-data or nobody).

With safe mode enabled, you can only access directories that are owned
by you. <>
Php has to solve the lack-of-suexec-behavior problem,
somehow, someway. Else it's a make believe system,
at least in the virtualhost environment.


You can also run php in a suexec environment.

--
Tim Van Wassenhove <http://home.mysth.be/~timvw/contact.php>
Jul 17 '05 #2
iuz
Salmo Bytes wrote:
I have a script that wants to mirror
a directory structure, reading
from location1 and writing (mkdir) at location2.

This code works fine on a my own desktop test box.
But fails at 'mkdir' when run on virtualhost box
with safe_mode enabled and virtual (chrooted?)
filesystems.

My script makes the first top-level directory just
fine, but fails on subsequent, nested mkdirs,
producing the error message:

Warning: mkdir(): SAFE MODE Restriction in effect. The script whose
uid is 669 is not allowed to access /home/virtual/site...path to dir I
just made

There must be a solution.
chmod($newdir, 0777) doesn't
seem to help.

Php has to solve the lack-of-suexec-behavior problem,
somehow, someway. Else it's a make believe system,
at least in the virtualhost environment.


the only solution i elaborate its creating dir with ftp function..

if you found another method or want some example code contact me
garbage'AT'iuz-lab.info 'AT' = @

--
--
www.iuz-lab.info
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Henrik Oddershede | last post: by
reply views Thread by Gerrit Kuilder | last post: by
1 post views Thread by David Ruiz | last post: by
1 post views Thread by Felix Natter | last post: by
1 post views Thread by ramc18@tiscali.it | last post: by
30 posts views Thread by MikeC | last post: by
reply views Thread by Zeilkman | last post: by
2 posts views Thread by _q_u_a_m_i_s's | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.