Title: Copy File Error
Last modified: August 31, 2016

---

# Copy File Error

 *  Resolved [miguelkennedy](https://wordpress.org/support/users/miguelkennedy/)
 * (@miguelkennedy)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/copy-file-error/)
 * Hi,
 * I get several “Fail: Copying file has been failed and will be skipped:”
 * I’ve read somewhere that it might be a permission problem. How do I know which
   files where skipped? The log just gives the above error.
 * Thanks!
 * [https://wordpress.org/plugins/wp-staging/](https://wordpress.org/plugins/wp-staging/)

Viewing 14 replies - 16 through 29 (of 29 total)

[←](https://wordpress.org/support/topic/copy-file-error/?output_format=md) [1](https://wordpress.org/support/topic/copy-file-error/?output_format=md)
2

 *  Thread Starter [miguelkennedy](https://wordpress.org/support/users/miguelkennedy/)
 * (@miguelkennedy)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/copy-file-error/page/2/#post-6939566)
 * It should be in the wp-content folder of wordpress site
 *  [edpirone](https://wordpress.org/support/users/edpirone/)
 * (@edpirone)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/copy-file-error/page/2/#post-6939567)
 * Not getting anything generated on this end. I think I might just axe this whole
   thing completely and export the db, import to a new db and copy the files over
   to a new directory.
 * This is turning into a “thing”.
 *  Thread Starter [miguelkennedy](https://wordpress.org/support/users/miguelkennedy/)
 * (@miguelkennedy)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/copy-file-error/page/2/#post-6939568)
 * Can you check your apache and php logs? They might contain useful information
   regarding the fact that the copy process fails..
 *  [edpirone](https://wordpress.org/support/users/edpirone/)
 * (@edpirone)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/copy-file-error/page/2/#post-6939569)
 * I have access to that stuff but I am not sure how to find them. I am FTP’d into
   the root right now.
 *  Thread Starter [miguelkennedy](https://wordpress.org/support/users/miguelkennedy/)
 * (@miguelkennedy)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/copy-file-error/page/2/#post-6939570)
 * I don’t use apache but I think the logs should be in /var/log/apache2/ and php
   in /var/log/php
 *  [edpirone](https://wordpress.org/support/users/edpirone/)
 * (@edpirone)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/copy-file-error/page/2/#post-6939571)
 * doesn’t look like I am generating a PHP error log and the apache log definitely
   doesn’t have anything useful. I just looked through it to make sure there was
   no sensitive information. Nothing that relates to this at all.
 *  Thread Starter [miguelkennedy](https://wordpress.org/support/users/miguelkennedy/)
 * (@miguelkennedy)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/copy-file-error/page/2/#post-6939572)
 * [http://askubuntu.com/questions/14763/where-are-the-apache-and-php-log-files](http://askubuntu.com/questions/14763/where-are-the-apache-and-php-log-files)
 *  [edpirone](https://wordpress.org/support/users/edpirone/)
 * (@edpirone)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/copy-file-error/page/2/#post-6939573)
 * I think I found em.
 * Getting a lot of errors like this.
 * [Thu Mar 03 13:28:50 2016] [error] [client MY.IP.ADDRESS] PHP Warning: copy(/
   var/www/vhosts/sharphat.com/httpdocs/stage/google925ea119100090e1.html): failed
   to open stream: No such file or directory in /var/www/vhosts/sharphat.com/httpdocs/
   wp-content/plugins/wp-staging/includes/template-functions.php on line 907, referer:
   [http://sharphat.com/wp-admin/admin.php?page=wpstg_clone](http://sharphat.com/wp-admin/admin.php?page=wpstg_clone)
   [
   Thu Mar 03 13:28:52 2016] [error] [client MY.IP.ADDRESS] PHP Warning: mkdir():
   Permission denied in /var/www/vhosts/sharphat.com/httpdocs/wp-content/plugins/
   wp-staging/includes/template-functions.php on line 877, referer: [http://sharphat.com/wp-admin/admin.php?page=wpstg_clone](http://sharphat.com/wp-admin/admin.php?page=wpstg_clone)[
   Thu Mar 03 13:28:52 2016] [error] [client MY.IP.ADDRESS] PHP Warning: mkdir():
   No such file or directory in /var/www/vhosts/sharphat.com/httpdocs/wp-content/
   plugins/wp-staging/includes/template-functions.php on line 962, referer: [http://sharphat.com/wp-admin/admin.php?page=wpstg_clone](http://sharphat.com/wp-admin/admin.php?page=wpstg_clone)[
   Thu Mar 03 13:28:52 2016] [error] [client MY.IP.ADDRESS] PHP Warning: copy(/var/
   www/vhosts/sharphat.com/httpdocs/stage/wp-admin/options-discussion.php): failed
   to open stream: No such file or directory in /var/www/vhosts/sharphat.com/httpdocs/
   wp-content/plugins/wp-staging/includes/template-functions.php on line 907, referer:
   [http://sharphat.com/wp-admin/admin.php?page=wpstg_clone](http://sharphat.com/wp-admin/admin.php?page=wpstg_clone)
 *  [edpirone](https://wordpress.org/support/users/edpirone/)
 * (@edpirone)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/copy-file-error/page/2/#post-6939574)
 * Looks like it is saying that the file doesn’t exist but it definitely does.
 *  [edpirone](https://wordpress.org/support/users/edpirone/)
 * (@edpirone)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/copy-file-error/page/2/#post-6939575)
 * Jesus christ. I logged in as Root and went to the httpd folder and changed permissions
   from 755 to 777 and now it looks like it is working. I had previously changed
   every folder in the root and file to 777 and I assume that would be enough.
 * It might be a nice added on to address a scenario like this in the actual plugin.
   Obviously you guys have to make a living though so the amount of attention you
   gave me today is outstanding. Ill be back in 10 to let you know if this worked.
 *  Thread Starter [miguelkennedy](https://wordpress.org/support/users/miguelkennedy/)
 * (@miguelkennedy)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/copy-file-error/page/2/#post-6939576)
 * edpirone… DId it work? Are you able to make staging sites with wp-staging plugin?
 *  Plugin Author [Rene Hermenau](https://wordpress.org/support/users/renehermi/)
 * (@renehermi)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/copy-file-error/page/2/#post-6939577)
 * [@miguelkennedy](https://wordpress.org/support/users/miguelkennedy/) at first
   thank you for the outstanding support. Thats really awesome:)
 * [@edpirone](https://wordpress.org/support/users/edpirone/) its not recommended
   to have all files and folders to permission 777 and usually thats not needed 
   for wp staging. I think the permission issue can be fixed as well when you keep
   755 for folders and 644 for files and just change the owner of the files and 
   folders to the same owner php is running under. This owner is often named www-
   data or www depending on your configuration.
 * I am going to create a FAQ which treats the issues you had so other guys will
   not run into same results:)
 *  Thread Starter [miguelkennedy](https://wordpress.org/support/users/miguelkennedy/)
 * (@miguelkennedy)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/copy-file-error/page/2/#post-6939578)
 * Rene, no problem 😉
 * I was going to say the same thing about the permissions security risks…
 * edpirone, here’s what I recomend:
 * 1) Go here [https://gist.github.com/Adirael/3383404](https://gist.github.com/Adirael/3383404)
   and click the “Download ZIP” button.
    2) Unzip the file, open the sh file with
   notepad (if you’re on windows) or textmate if you’re on mac). 3) Change WP_ROOT
   =$1 to WP_ROOT=/var/www/vhosts/sharphat.com/httpdocs/ 4) Save the file
 * I’m going to assume you’re on a Linux/Ubuntu server. If not, let me nknow.
 * 5) FTP to your server with root and place the sh file in /usr/local/etc/
 * Now you need to login to your server with SSH… If you have root access then you
   should have SSH access as well.
 * Once you’re logged in with SSH type the following command:
 * sudo /bin/bash /usr/local/etc/fix-wordpress-permissions.sh
 * It will take at least 1-2 minutes to run and you’ll have ALL files and folders
   of your wordpress installation with correct permissions based on recommendations
   
   from [http://codex.wordpress.org/Hardening_WordPress#File_permissions](http://codex.wordpress.org/Hardening_WordPress#File_permissions)
 * Do this as soon as possible because you’re site is currently at risk. Never give
   full 777 permissions to an entire site.
 * Hope this helps
 *  [edpirone](https://wordpress.org/support/users/edpirone/)
 * (@edpirone)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/copy-file-error/page/2/#post-6939579)
 * Yea guys. I got everything working. I am now switching the folders/files to 755/
   644 respectively. I just was shocked that the main issue was the root folder 
   had to be 777 for it to work. Once that worked it was smooth as can be. I assumed
   it was a permission thing from the beginning but once I had switched literally
   everything to 777 except for the root I got really confused it wasn’t working.
   Anyway. Thank you.

Viewing 14 replies - 16 through 29 (of 29 total)

[←](https://wordpress.org/support/topic/copy-file-error/?output_format=md) [1](https://wordpress.org/support/topic/copy-file-error/?output_format=md)
2

The topic ‘Copy File Error’ is closed to new replies.

 * ![](https://ps.w.org/wp-staging/assets/icon-256x256.png?rev=2972932)
 * [WP STAGING - WordPress Backups, Restore, Migration & Clone](https://wordpress.org/plugins/wp-staging/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-staging/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-staging/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-staging/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-staging/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-staging/reviews/)

 * 29 replies
 * 3 participants
 * Last reply from: [edpirone](https://wordpress.org/support/users/edpirone/)
 * Last activity: [10 years, 5 months ago](https://wordpress.org/support/topic/copy-file-error/page/2/#post-6939579)
 * Status: resolved