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

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
User avatar
dharprog
Forum Contributor
Posts: 126
Joined: Fri Oct 27, 2006 12:20 am

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

Post by dharprog »

Hi

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

Thank you.
Last edited by dharprog on Sun Aug 05, 2007 12:05 am, edited 1 time in total.
User avatar
iknownothing
Forum Contributor
Posts: 337
Joined: Sun Dec 17, 2006 11:53 pm
Location: Sunshine Coast, Australia

Post 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
User avatar
dharprog
Forum Contributor
Posts: 126
Joined: Fri Oct 27, 2006 12:20 am

Post 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.
User avatar
iknownothing
Forum Contributor
Posts: 337
Joined: Sun Dec 17, 2006 11:53 pm
Location: Sunshine Coast, Australia

Post 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.
User avatar
dharprog
Forum Contributor
Posts: 126
Joined: Fri Oct 27, 2006 12:20 am

Post 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.
User avatar
vigge89
Forum Regular
Posts: 875
Joined: Wed Jul 30, 2003 3:29 am
Location: Sweden

Post 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.
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

Have you tried chmod()
User avatar
dharprog
Forum Contributor
Posts: 126
Joined: Fri Oct 27, 2006 12:20 am

Post 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.
User avatar
dharprog
Forum Contributor
Posts: 126
Joined: Fri Oct 27, 2006 12:20 am

Post 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.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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.
User avatar
dharprog
Forum Contributor
Posts: 126
Joined: Fri Oct 27, 2006 12:20 am

Post 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.
Post Reply