473,386 Members | 1,830 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,386 software developers and data experts.

opendir() in safe mode

What do I need to change to use the opendir() function when safe mode is
in affect??
I have root access to the server and can make any changes neccessary
except turn safe mode off

Thanks in advance,
Jeremy
Jul 17 '05 #1
3 4404
Jeremy Shovan wrote:
What do I need to change to use the opendir() function when safe mode is
in affect??
I have root access to the server and can make any changes neccessary
except turn safe mode off

Thanks in advance,
Jeremy


who is the owner of the web server process? I could be wrong, but make
sure the process owner has access to the directory you are trying to
open. (ie in the same group, etc...)

(but I am not wrong: see:

go to the PHP site and search for "safe mode opendir" in the "online
docs"

and you will find:

http://www.php.net/rmdir
.....
"Note: When safe mode is enabled, PHP checks whether the directory in
which you are about to operate has the same UID (owner) as the script
that is being executed."

Michael Austin.
Jul 17 '05 #2
Michael Austin wrote:
Jeremy Shovan wrote:
What do I need to change to use the opendir() function when safe mode
is in affect??
I have root access to the server and can make any changes neccessary
except turn safe mode off

Thanks in advance,
Jeremy

who is the owner of the web server process? I could be wrong, but make
sure the process owner has access to the directory you are trying to
open. (ie in the same group, etc...)

(but I am not wrong: see:

go to the PHP site and search for "safe mode opendir" in the "online
docs"

and you will find:

http://www.php.net/rmdir
....
"Note: When safe mode is enabled, PHP checks whether the directory in
which you are about to operate has the same UID (owner) as the script
that is being executed."

Michael Austin.


Thanks for the reply. I understand that much but my problem is that I
need scripts with different uid's to access the directory that I am
opening. The code is used with several sites on the server. I read the
documentation already but I dont quite understand what to do. I set the
safe_mode_include_dir and safe_mode_exec_dir in the php.ini file but
that didn't work.

Jeremy
Jul 17 '05 #3
Jeremy Shovan wrote:
Michael Austin wrote:
Jeremy Shovan wrote:
What do I need to change to use the opendir() function when safe mode
is in affect??
I have root access to the server and can make any changes neccessary
except turn safe mode off

Thanks in advance,
Jeremy


who is the owner of the web server process? I could be wrong, but make
sure the process owner has access to the directory you are trying to
open. (ie in the same group, etc...)

(but I am not wrong: see:

go to the PHP site and search for "safe mode opendir" in the "online
docs"

and you will find:

http://www.php.net/rmdir
....
"Note: When safe mode is enabled, PHP checks whether the directory in
which you are about to operate has the same UID (owner) as the script
that is being executed."

Michael Austin.

Thanks for the reply. I understand that much but my problem is that I
need scripts with different uid's to access the directory that I am
opening. The code is used with several sites on the server. I read the
documentation already but I dont quite understand what to do. I set the
safe_mode_include_dir and safe_mode_exec_dir in the php.ini file but
that didn't work.

Jeremy


try putting the UID's and directories in the same group (btw, I am
"assuming" that this is Unix/Linux) chgrp dir <group of UID> and setting
the protections to 664 or 764 or 774... using chmod.
||+--> World Privilege
|+---> Group Privilege
+----> Owner Privilege
7 = rwx
6 = rw-
5 = r-x
4 = r--
3 = -wx
2 = -w-
1 = --x
0 = ---
Michael Austin.
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Giobibo | last post by:
Hi. I want to send mail with the function mail(). I am on a shared server in SAFE MODE. When I send a mail I get the message: "SAFE MODE Restriction in effect. The fifth parameter is...
0
by: Yemi | last post by:
Hi There. I seem to be getting some inconsistent results when using passthru() in safe mode. They appear to be related to the fact that passthru should treat all command arguments as one single...
2
by: Paul Schmidinger | last post by:
Hi, I created a directory with PHP mkdir (mode 0777). Then I try to move_ulpoaded_file() to move a file into this directory. I get an error: Warning: move_uploaded_file(): SAFE MODE...
2
by: Alex | last post by:
Greetings all, I'm trying to use the "opendir" command on Win32 in a CGI script. I'm using Apache 2.0.48 for Win32. The "openDir" command works from the CGI script when I try to open a...
2
by: Joseph S. | last post by:
Hi all, Consider this case: I have a free php hosting account (a LAMP host) with an account name (also the name of my directory) 'sample'. Under 'sample', I have php scripts which can create...
1
by: Sephi | last post by:
Hello, I'm trying to disable safe mode from my php installation. First because this functionality will be removed in PHP6, and because it's very restrictive and it's giving me headaches when...
7
code green
by: code green | last post by:
I am trying to access files on a different drive but the same server to where the script is running. but I only get the error failed to open dir: Invalid argument in...
5
by: rdlowrey | last post by:
Hi, I'm pulling my hair out trying to make this work and any help would be appreciated ... When I try to move the uploaded file: move_uploaded_file($_FILES,"/var/www/vhosts/...
7
by: bvdp | last post by:
I'm finding my quest for a safe eval() quite frustrating :) Any comments on this: Just forget about getting python to do this and, instead, grab my set of values (from a user supplied text file)...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.