By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,649 Members | 2,154 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,649 IT Pros & Developers. It's quick & easy.

safe_mode and mkdir in a loop

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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.