Can't CHMOD nor write to a file...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
PencWeb
Forum Newbie
Posts: 7
Joined: Thu Sep 19, 2002 3:39 pm
Location: USA

Can't CHMOD nor write to a file...

Post by PencWeb »

I posted a topic at another forum to try and get help, but none was useful. :(

Here is the URL to it, as I don't wanna rewrite what my problem is.

http://www.webhostingtalk.com/showthrea ... adid=74979

Please help me someone if you can!!!

- Shawn
User avatar
AVATAr
Forum Regular
Posts: 524
Joined: Tue Jul 16, 2002 4:19 pm
Location: Uruguay -- Montevideo
Contact:

code

Post by AVATAr »

Why dont you place some code? :D
PencWeb
Forum Newbie
Posts: 7
Joined: Thu Sep 19, 2002 3:39 pm
Location: USA

Why?

Post by PencWeb »

Well why should I? All the script is doing, is CHMODing a file in 3 directories away, and then attempting to write to it. But it doesn't work. :( Could it be because of like the 'owner' or whatever I need to change? The script works fine on my computer, but then when I upload it to a real server and try it, I get that error when I execute it. And of course, all permissions on the directories leading up to the file are at 777.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Have you read through the docs on safe mode to see how the functions you are using are affected by it?

Mac
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Here's the original post in case someone else is searching this forum with the same question:
PencWeb wrote:Ok now the following error happens because I want to write to a file I have created and CHMOD to 777, but it gives me this error instead What are the numbers "10003" and "2525" suppose to mean? I don't know if I'm getting this error because I am basically creating a file in 3 directories ahead of where the script is held. But I really need help on this, please!

Warning: SAFE MODE Restriction in effect. The script whose uid is 10003 is not allowed to access boards/topics/Socializing/Please work!+data owned by uid 2525 in /usr/local/psa/home/vhosts/penchosting.com/httpdocs/my1bb/topic.php on line 199
Mac
PencWeb
Forum Newbie
Posts: 7
Joined: Thu Sep 19, 2002 3:39 pm
Location: USA

Thanks!

Post by PencWeb »

No I haven't read that, thanks so much, I'm pretty sure that's exactly what I need ! :D


Cheers!
- Shawn
PencWeb
Forum Newbie
Posts: 7
Joined: Thu Sep 19, 2002 3:39 pm
Location: USA

Post by PencWeb »

Hmmm... Well basically all the people that gave solutions to solve this, had access to their php.ini file, and I really don't, cuz it's on a server that I totally do not have access to those kinds of files.
But how would I get it to work, with just dealing with functions?
Would this work:
(myuid() and fileowner()) as UID = 0
And how would I use it correctly to bipass the stupid safe mode?

- Shawn :(
PencWeb
Forum Newbie
Posts: 7
Joined: Thu Sep 19, 2002 3:39 pm
Location: USA

COME ON

Post by PencWeb »

Come on, NO ONE CAN HELP ME ??? :?: This is a Forums, I NEED TO FINISH IT! :(

- Shawn
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

Post by hob_goblin »

Turn it off, at least in that directory..
PencWeb
Forum Newbie
Posts: 7
Joined: Thu Sep 19, 2002 3:39 pm
Location: USA

Post by PencWeb »

Is there some sort of FUNCTION that can do this? I don't want to have to get my host to do it by editing the php.ini file :?
This is a BB I am making, it wouldn't be smart to have a requirement of Safe Mode be turned off, or that the consumer has to have access to adding something to the php.ini file :evil: Just won't work!

COME ONE PEOPL! :(

- Shawn
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Yelling won't make people help you any faster. Maybe what you need to do is read up on safe mode, check the output of

Code: Select all

<?php phpinfo(); ?>
to see what level your webserver admin(s)/host have set it up as and maybe have a talk with them to see if they can lower some of the restrictions for you. I appreciate that you don't want to ask them but you'll probably have to I find it unlikely that there'd be a way (having never had to deal with safe mode I can't be 100% about this) of disabling it other than in the php.ini. If you explain the problem to your host they may have some suggestions of how you can get things working on their server.

Mac
PencWeb
Forum Newbie
Posts: 7
Joined: Thu Sep 19, 2002 3:39 pm
Location: USA

Post by PencWeb »

Yeah I've already looked at phpinfo(). Safe Mode is on, and so is the Open Base Directory thing. Perhaps I'll talk to my host, although, this is not the route I wanted to go. :(

Oh hey, do you know how I can write to a file with using the function system() ?

- Shawn
Post Reply