473,378 Members | 1,577 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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
2 2418
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Henrik Oddershede | last post by:
Hi. I am having a problem with safe_mode in PHP-4.3.2. I was running an Apache-1.3.27 web server on solaris8 with PHP-4.3.1 with safe_mode on - and everything was working fine. Yesterday, I...
0
by: Gerrit Kuilder | last post by:
Hello All, I have the following question: a hosting provider has turned local safe_mode off and the master safe_mode is on. This prevents an application/php script to work. The provider...
1
by: David Ruiz | last post by:
Hi all, I've tried to compile PHP-4.3.3 for a HORDE installation and it requires that PHP is compiled with safe_mode disabled. I compiled it like this: --disable-safe_mode...
1
by: Felix Natter | last post by:
hi, I would like to upload a file (via a form), then read that (temporary) file and write the contents into a database. The first problem is that open_basedir=/home/CUSTOMER so I can't just read...
0
by: bedek | last post by:
Hello How to set BASH variable form PHP which is working in "safe_mode" ? .... and to check if it's set for sure ? I find out that I should create directory for binaries in home direcotry of...
1
by: ramc18 | last post by:
My PHP.INI configuration have safe_mode = Off but in local execution it get On. I noticed this strange behaviour with a script that shows an error in move_uploaded_file. I write a minimal script...
30
by: MikeC | last post by:
Good People, I'm writing a backup utility that uses a chdir() to go into the source directory (in which the files reside that I want to back up), so I don't want to use chdir() to get into the...
0
by: Zeilkman | last post by:
Hi everybody, I'm runing LAMP on a Fedora 7 + Plesk server. PHP Version 5.0.4 Apache 2.0 Handler The "local value" of Safe Mode is ON and the "master value" is OFF I try to change the...
2
by: _q_u_a_m_i_s's | last post by:
Hy, i encountered a weird problem on a server running php5, and apache. Seems like i cannot create folders that end with "/". for example: mkdir("test/") will fail mkdir("test") will work Is...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.