I have a server with safe mode on, I create folders via FTP and copy files with fwrite, so far it is a little mess but is working, if some one knows a class that can make it more simple I apreciate.
My problem is that if I want to copy files the folder must have chmod at 777. I try to change the chmod at the beggining and at the end of the copy, but I dont have the rigths to do it.
This is my first problem, my second is that once I create the file, this must require other file, the typical require_once sentence but I get this error
Warning: require_once() [function.require-once]: SAFE MODE Restriction in effect. The script whose uid is 48 is not allowed to access
This require has the data base configuration, therefore I put it out of the folder with 777 permissions.
Does anyone know a way to avoid or solve this problems?
I cant change the safe_mode because is not a private server.
Thanks in advance.
Create files & folders safe mode ON
Moderator: General Moderators
Re: Create files & folders safe mode ON
Try to add this line to the .htaccess file in your directory:
About chmod ... only the owner and the super user (root) can change file permissions.
Code: Select all
php_admin_value safe_mode OffThere are 10 types of people in this world, those who understand binary and those who don't
Re: Create files & folders safe mode ON
I cant change the safe mode via .htaccess, it give me a missconfiguration error.
The thing is that the user that created the folders is the owner and is the same user that Im using to change the permissions.
The thing is that the user that created the folders is the owner and is the same user that Im using to change the permissions.
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
Re: Create files & folders safe mode ON
The only work around is to use FTP programmatically from PHP. Find a FTP class and goto town.
This is required because FTP runs under a different user than PHP/Apache. PITA I know.
This is required because FTP runs under a different user than PHP/Apache. PITA I know.