Page 1 of 1

[solved][56K WARN] Php directory copy (empty) in php

Posted: Thu Aug 02, 2007 11:10 pm
by dharprog
Hi

Can anybody please tell me how to copy a directory from one folder to another folder.?

Thank you.

Posted: Thu Aug 02, 2007 11:42 pm
by iknownothing
TO MOVE:
untested, works for file, unsure of folder

http://au.php.net/manual/en/function.rename.php


EDIT: Acording to the comments on the above page, it should work.

Code: Select all

rename("folder1/folder2", "folder4/folder2"); //WILL NOT LEAVE ORIGINAL
TO COPY:

http://au2.php.net/copy

Code: Select all

copy("folder1/folder2", "folder4/folder2") //WILL LEAVE ORIGINAL

Posted: Fri Aug 03, 2007 11:29 am
by dharprog
Hi

Thanks for the response.

But i tried with your suggestions but not working on the server but working in my local computer.

Thank you.

Posted: Fri Aug 03, 2007 11:41 am
by iknownothing
I've noticed, after looking at another thread somewhere on here, that my Server doesn't allow me to do this either.

Permissions issues.

Posted: Fri Aug 03, 2007 11:44 am
by dharprog
Hi

Then what is the solution for this? How to change the permissions? Please tell me if you have any idea regarding this?

Thank you.

Posted: Fri Aug 03, 2007 12:20 pm
by vigge89
The host might have turned PHPs safe mode on. In that case the only way for you to solve this is to ask your hosting provider.

Posted: Fri Aug 03, 2007 2:21 pm
by hawleyjr
Have you tried chmod()

Posted: Sat Aug 04, 2007 2:54 am
by dharprog
Hi
vigge89 wrote:The host might have turned PHPs safe mode on. In that case the only way for you to solve this is to ask your hosting provider.

I made the phps safe mode off, You can check that in this image screen which phpinof() of the server.

Image

After changing this to safe mode off also not working the file copy or directory(Empty) copy.

Thank you.

Posted: Sat Aug 04, 2007 3:03 am
by dharprog
Hi

one more thing i just came to know that after turning phps safe mode off even now i cant make a directory there by using the function mkdir(). when it is on it used to create a directory but now its not working.

Thank you.

Posted: Sat Aug 04, 2007 3:55 am
by Chris Corbyn
hawleyjr wrote:Have you tried chmod()
If you don't have permission to copy you certainly won't have permission to change the permissions ;)

You'll have to change the permissions over FTP where you probably own the files. Make whatver needs to be written to "777" with the CHMOD command. In this case it's the parent directory.

Posted: Sun Aug 05, 2007 12:04 am
by dharprog
Hi

First of all Happy Friendship day to all.


Thanks to every body here who were trying to help me.

I just got the solution for the time being but still we have to make it perfect.

The solution mostly what i got is safe-mode off and permissions (chmod to rwx for the three users like group,owner and others) to main directory and copying file to be set to permissions of the same.

But the the thing owner and group settings are still a miserable thing but for now its working well.

Thank you very much.