Internal Server Error 500 when using copy()

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
mattcooper
Forum Contributor
Posts: 210
Joined: Thu Mar 17, 2005 5:51 am
Location: London, UK

Internal Server Error 500 when using copy()

Post by mattcooper »

Hi,

I'm having trouble getting some - but not all - files to copy from one folder to another upon a mkdir() command. Most copy over fine, but even though all files in the source folder are chmod777, they will not copy. Two are .php files, one is an .inc file.

Code contains sensetive URL's, so I'm afraid I can't post it here without serious editing, but everything appears to be fine, so I'm guessing the problem does indeed lie with the server.

Anyone have any tips?

Thanks in advance.
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

As far as I am aware, the E500 error code is a very generic, essentially saying "Something broke on the backend"

My first guesses would be to
1.check the user permissions (which you have)
2.is the file in use and thus locked?
3.drive space?

And other such troubleshooting :)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Are the files it fails to copy consistent, through renaming, changing of source location, number of files? If it does, it's a server issue most often.

I'd like to understand why you need to copy the files.
User avatar
mattcooper
Forum Contributor
Posts: 210
Joined: Thu Mar 17, 2005 5:51 am
Location: London, UK

Post by mattcooper »

Thanks guys.

I need to copy the files following the creation of a new folder, to keep things simple for the system my customer has requested. There is an admin page int he root folder of their site which gices the facility to create or delete files and folders. Each time a folder is created, several important files for the running of the admin suite need to be placed into it, and I'm doing that by copying generic files from a seperate folder.

I haven't checked that the location of the files is causing the problem yet, but most likely isn't. I know that the files are not currently in use, because nobody knows they exist yet!

Drive space is not an issue as our server has loads and loads left, and the files I'm copying are tiny anyway.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

wouldn't it be better to keep those files in a central location and simply include them or something? Or are the "customized" to their new location? Even then, the customization can be performed by the file itself from a central location, most often.
User avatar
mattcooper
Forum Contributor
Posts: 210
Joined: Thu Mar 17, 2005 5:51 am
Location: London, UK

Post by mattcooper »

OK, tried moving the files, and still a got an error on one in particular, which seems to crash the rest of the copying, so it seems to be that particular file. It has, however, been set to 744 - although when I try to set it to 777, I get the dreaded "Forbidden" or "500" message.

So what's up here?
Post Reply