Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inconsistent safe mode restriction

Status
Not open for further replies.

jgd12345

Technical User
Joined
Apr 22, 2003
Messages
124
Location
GB
Hi, I already knew my server ran php in safe mode but I don't understand why I'm receiving this message. The code I'm trying to run is:

mkdir("$path/$directory", 0777);
chmod("$path/$directory", 0777);
mkdir("$path/$directory/basstabs", 0777);
chmod("$path/$directory/basstabs", 0777);
mkdir("$path/$directory/drumtabs", 0777);
chmod("$path/$directory/drumtabs", 0777);
mkdir("$path/$directory/guitartabs", 0777);
chmod("$path/$directory/guitartabs", 0777);
mkdir("$path/$directory/lyrics", 0777);
chmod("$path/$directory/lyrics", 0777);

When I ran this the first directory is created but none of the sub directories are created. The message I receive is at the bottom when I set the variable $directory equal to bandname. I would appreciate you help. Thanx in advance.

Warning: SAFE MODE Restriction in effect. The script whose uid is 560 is not allowed to access /home/virtual/site56/fst/var/ owned by uid 48 in /home/virtual/site56/fst/var/ on line 112

Warning: Unable to access /home/virtual/site56/fst/var/ in /home/virtual/site56/fst/var/ on line 113

Warning: chmod failed: No such file or directory in /home/virtual/site56/fst/var/ on line 113

Warning: SAFE MODE Restriction in effect. The script whose uid is 560 is not allowed to access /home/virtual/site56/fst/var/ owned by uid 48 in /home/virtual/site56/fst/var/ on line 114

Warning: Unable to access /home/virtual/site56/fst/var/ in /home/virtual/site56/fst/var/ on line 115

Warning: chmod failed: No such file or directory in /home/virtual/site56/fst/var/ on line 115

Warning: SAFE MODE Restriction in effect. The script whose uid is 560 is not allowed to access /home/virtual/site56/fst/var/ owned by uid 48 in /home/virtual/site56/fst/var/ on line 116

Warning: Unable to access /home/virtual/site56/fst/var/ in /home/virtual/site56/fst/var/ on line 117

Warning: chmod failed: No such file or directory in /home/virtual/site56/fst/var/ on line 117

Warning: SAFE MODE Restriction in effect. The script whose uid is 560 is not allowed to access /home/virtual/site56/fst/var/ owned by uid 48 in /home/virtual/site56/fst/var/ on line 118

Warning: Unable to access /home/virtual/site56/fst/var/ in /home/virtual/site56/fst/var/ on line 119

Warning: chmod failed: No such file or directory in /home/virtual/site56/fst/var/ on line 119
 
The ownership of both the directories you mentioned is 777. Not too sure how to answer your other question sorry. Thanx for replying
 
You've probably picked up on this, but I'm quite new to php, I don't really understand your reply. I tried looking on php.net/manual and found this but not sure what it does and how to use it if it could help me.

<Directory /vhosts/domain.com/httpdocs/>
php_admin_value safe_mode 0
php_admin_value open_basedir &quot;/&quot;
</Directory>&quot;
 
A file (or a directory) on a filesystem has an owner, and a set of permissions that control how that owner and others access that file.

You've told me the access permissions, but I need to know who owns the directory (what username) and the name of the user PHP runs as.

Want the best answers? Ask the best questions: TANSTAAFL!
 
Hi, I've decided that due to server restrictions I will store the data in the database. I was just wondering what security checks would need tobe made, ie if I have a form with a textarea box called &quot;tab&quot; then when the form is submitted the following is carried out:

mysql_query(&quot;INSERT INTO tabs VALUES('', '$tab')&quot;);

I need to make this checks because the data inserted into this table is inserted by users I don't trust.

I'd be greatful for your help. Thanx
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top