Title: Goes into a loop
Last modified: August 21, 2016

---

# Goes into a loop

 *  Resolved [Svetoslav Marinov](https://wordpress.org/support/users/lordspace/)
 * (@lordspace)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/goes-into-a-loop/)
 * Hi,
 * I have a mass vhost setup where apache handles 100s of sites from one setup.
 * I think the problem from using this
    $_SERVER[‘DOCUMENT_ROOT’].’/wp-content/’
   which caused your copy function to go in a infinite loop. My log file became 
   ~ 500MB
 * [25-Oct-2013 22:19:18 UTC] PHP Warning: readdir() expects parameter 1 to be resource,
   boolean given in /var/www/vhosts/qsandbox.com/sites/c/h/i/childtheme.qsandbox.
   com/htdocs/wp-content/plugins/duplicate-theme/duplicate-theme.php on line 148
   [
   25-Oct-2013 22:19:18 UTC] PHP Warning: copy(/var/www/vhosts/qsandbox.com/htdocs/
   wp-content/themes/twentythirteen/): failed to open stream: No such file or directory
   in /var/www/vhosts/qsandbox.com/sites/c/h/i/childtheme.qsandbox.com/htdocs/wp-
   content/plugins/duplicate-theme/duplicate-theme.php on line 154 [25-Oct-2013 
   22:19:18 UTC] PHP Warning: readdir() expects parameter 1 to be resource, boolean
   given in /var/www/vhosts/qsandbox.com/sites/c/h/i/childtheme.qsandbox.com/htdocs/
   wp-content/plugins/duplicate-theme/duplicate-theme.php on line 148 [25-Oct-2013
   22:19:18 UTC] PHP Warning: copy(/var/www/vhosts/qsandbox.com/htdocs/wp-content/
   themes/twentythirteen/): failed to open stream: No such file or directory in /
   var/www/vhosts/qsandbox.com/sites/c/h/i/childtheme.qsandbox.com/htdocs/wp-content/
   plugins/duplicate-theme/duplicate-theme.php on line 154 [25-Oct-2013 22:19:18
   UTC] PHP Warning: readdir() expects parameter 1 to be resource, boolean given
   in /var/www/vhosts/qsandbox.com/sites/c/h/i/childtheme.qsandbox.com/htdocs/wp-
   content/plugins/duplicate-theme/duplicate-theme.php on line 148 [25-Oct-2013 
   22:19:18 UTC] PHP Warning: copy(/var/www/vhosts/qsandbox.com/htdocs/wp-content/
   themes/twentythirteen/): failed to open stream: No such file or directory in /
   var/www/vhosts/qsandbox.com/sites/c/h/i/childtheme.qsandbox.com/htdocs/wp-content/
   plugins/duplicate-theme/duplicate-theme.php on line 154 [25-Oct-2013 22:19:18
   UTC] PHP Warning: readdir() expects parameter 1 to be resource, boolean given
   in /var/www/vhosts/qsandbox.com/sites/c/h/i/childtheme.qsandbox.com/htdocs/wp-
   content/plugins/duplicate-theme/duplicate-theme.php on line 148
 * Slavi
 * [http://wordpress.org/plugins/duplicate-theme/](http://wordpress.org/plugins/duplicate-theme/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Muller Digital Inc.](https://wordpress.org/support/users/muller-digital/)
 * (@muller-digital)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/goes-into-a-loop/#post-4257645)
 * Hi Slavi,
    Thanks for reporting the issue and pointing-out the cause of the problem.
   The predefined PHP variable has been replaced by the [get theme root](http://codex.wordpress.org/Function_Reference/get_theme_root)
   WordPress function, which should solve your issue. Hope it works for you. If 
   you have anymore issues, please post on the support page again. Thanks for using
   duplicate theme!

Viewing 1 replies (of 1 total)

The topic ‘Goes into a loop’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/duplicate-theme_2e4b61.svg)
 * [Duplicate Theme](https://wordpress.org/plugins/duplicate-theme/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/duplicate-theme/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/duplicate-theme/)
 * [Active Topics](https://wordpress.org/support/plugin/duplicate-theme/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/duplicate-theme/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/duplicate-theme/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Muller Digital Inc.](https://wordpress.org/support/users/muller-digital/)
 * Last activity: [12 years, 6 months ago](https://wordpress.org/support/topic/goes-into-a-loop/#post-4257645)
 * Status: resolved